trait MetaMapper[A <: Mapper[A]] extends BaseMetaMapper with Mapper[A]
- Alphabetic
- By Inheritance
- MetaMapper
- Mapper
- SourceInfo
- Serializable
- Serializable
- BaseMapper
- FieldContainer
- BaseMetaMapper
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- type AnyBound = T forSome {type T}
- case class FieldHolder (name: String, method: Method, field: MappedField[_, A]) extends Product with Serializable
-
type
FieldPF = PartialFunction[String, (NodeSeq) ⇒ NodeSeq]
- Definition Classes
- Mapper
-
type
MapperType = A
- Definition Classes
- Mapper → BaseMapper
- type OtherMapper = KeyedMapper[_, _]
- type OtherMetaMapper = KeyedMetaMapper[_, _]
-
type
RealType = A
- Definition Classes
- MetaMapper → BaseMetaMapper
Abstract Value Members
-
abstract
def
getSingleton: MetaMapper[A]
- Definition Classes
- Mapper
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
_dbTableNameLC: String
The table name, to lower case...
The table name, to lower case... ensures that it works on all DBs
- Definition Classes
- MetaMapper → BaseMetaMapper
-
def
addEndStuffs(in: String, params: List[QueryParam[A]], conn: SuperConnection): (String, Box[Long], Box[Long])
- Attributes
- protected
- def afterCommit: List[(A) ⇒ Unit]
- def afterCreate: List[(A) ⇒ Unit]
- def afterDelete: List[(A) ⇒ Unit]
- def afterSave: List[(A) ⇒ Unit]
-
def
afterSchemifier: Unit
- Definition Classes
- MetaMapper → BaseMetaMapper
- def afterUpdate: List[(A) ⇒ Unit]
- def afterValidation: List[(A) ⇒ Unit]
- def afterValidationOnCreate: List[(A) ⇒ Unit]
- def afterValidationOnUpdate: List[(A) ⇒ Unit]
-
def
allFieldNames(): Seq[(String, SourceFieldMetadata)]
Get a list of all the fields
-
def
allFields: Seq[BaseField]
- Definition Classes
- Mapper → FieldContainer
- def appendFieldToStrings(in: A): String
-
def
appendFieldTransform(transform: CssSel): Unit
- Definition Classes
- Mapper
- def asHtml(toLine: A): NodeSeq
-
def
asHtml: NodeSeq
- Definition Classes
- Mapper
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- def asJs(actual: A): JsExp
-
def
asJs: JsExp
Convert the model to a JavaScript object
Convert the model to a JavaScript object
- Definition Classes
- Mapper
-
def
asValid: Box[A]
Returns the instance in a Full Box if the instance is valid, otherwise returns a Failure with the validation errors
Returns the instance in a Full Box if the instance is valid, otherwise returns a Failure with the validation errors
- Definition Classes
- Mapper
- def beforeCreate: List[(A) ⇒ Unit]
- def beforeDelete: List[(A) ⇒ Unit]
- def beforeSave: List[(A) ⇒ Unit]
-
def
beforeSchemifier: Unit
- Definition Classes
- MetaMapper → BaseMetaMapper
- def beforeUpdate: List[(A) ⇒ Unit]
- def beforeValidation: List[(A) ⇒ Unit]
- def beforeValidationOnCreate: List[(A) ⇒ Unit]
- def beforeValidationOnUpdate: List[(A) ⇒ Unit]
- implicit def boundedFieldToItem(in: (MappedField[String, A], Int)): BoundedIndexField[A]
- def buildMapper(rs: ResultSet): List[Box[(ResultSet, Int, A) ⇒ Unit]]
-
def
buildSelectString(fields: Seq[SelectableField], conn: SuperConnection, by: QueryParam[A]*): (String, Box[Long], Box[Long], List[QueryParam[A]])
Given fields, a connection and the query parameters, build a query and return the query String, and Start or MaxRows values (depending on whether the driver supports LIMIT and OFFSET) and the complete List of QueryParams based on any synthetic query parameters calculated during the query creation.
Given fields, a connection and the query parameters, build a query and return the query String, and Start or MaxRows values (depending on whether the driver supports LIMIT and OFFSET) and the complete List of QueryParams based on any synthetic query parameters calculated during the query creation.
- fields
-- a Seq of the fields to be selected
- conn
-- the SuperConnection to be used for calculating the query
- by
-- the varg of QueryParams
- returns
a Tuple of the Query String, Start (offset), MaxRows (limit), and the list of all query parameters including and synthetic query parameters
- def bulkDelete_!!(dbId: ConnectionIdentifier, by: QueryParam[A]*): Boolean
- def bulkDelete_!!(by: QueryParam[A]*): Boolean
-
def
checkNames: Unit
- Definition Classes
- Mapper
-
def
clean_?(toCheck: A): Boolean
Returns true if none of the fields are dirty
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- val columnNamesForInsert: String
-
def
columnPrimaryKey_?(name: String): Boolean
This method returns true if the named column is the primary key and it is autogenerated
- val columnQueriesForInsert: String
-
def
comparePrimaryKeys(other: A): Boolean
- Definition Classes
- Mapper
-
def
connectionIdentifier: ConnectionIdentifier
- Definition Classes
- Mapper
-
def
connectionIdentifier(id: ConnectionIdentifier): A
- Definition Classes
- Mapper
- def count(by: QueryParam[A]*): Long
- def count: Long
- def countByInsecureSql(query: String, checkedBy: IHaveValidatedThisSQL): Long
- def countByInsecureSqlDb(dbId: ConnectionIdentifier, query: String, checkedBy: IHaveValidatedThisSQL): Long
- def countDb(dbId: ConnectionIdentifier, by: QueryParam[A]*): Long
-
def
countryField: Box[MappedCountry[A]]
- Definition Classes
- Mapper
- def create: A
- def createInstance: A
- def createInstance(dbId: ConnectionIdentifier, rs: ResultSet, mapFuncs: List[Box[(ResultSet, Int, A) ⇒ Unit]]): A
- def createInstances[T](dbId: ConnectionIdentifier, rs: ResultSet, start: Box[Long], omax: Box[Long], f: (A) ⇒ Box[T]): List[T]
- def createInstances(dbId: ConnectionIdentifier, rs: ResultSet, start: Box[Long], omax: Box[Long]): List[A]
-
def
dbAddTable: Box[() ⇒ Unit]
- Definition Classes
- MetaMapper → BaseMetaMapper
-
def
dbCalculateConnectionIdentifier: PartialFunction[A, ConnectionIdentifier]
- Definition Classes
- Mapper
- def dbDefaultConnectionIdentifier: ConnectionIdentifier
-
def
dbIndexes: List[BaseIndex[A]]
- Definition Classes
- MetaMapper → BaseMetaMapper
-
def
dbName: String
The name of the mapped object
The name of the mapped object
- Definition Classes
- MetaMapper → Mapper → BaseMapper
-
def
dbTableName: String
The name of the database table.
The name of the database table. Override this method if you want to change the table to something other than the name of the Mapper class
- Definition Classes
- MetaMapper → BaseMetaMapper
-
def
db_can_delete_?: Boolean
Can this model object be deleted?
Can this model object be deleted?
- Definition Classes
- Mapper
-
def
decodeFromJSON_!(json: JObject, markFieldsAsDirty: Boolean): A
Decode the fields from a JSON Object.
Decode the fields from a JSON Object. Should the fields be marked as dirty?
- Attributes
- protected
- def delete_!(toDelete: A): Boolean
-
def
delete_!: Boolean
Delete the model from the RDBMS
Delete the model from the RDBMS
- Definition Classes
- Mapper
- def dirty_?(toTest: A): Boolean
-
def
dirty_?: Boolean
- Definition Classes
- Mapper
-
val
displayFieldAsLineElement: (NodeSeq) ⇒ NodeSeq
This function converts an element into the appropriate XHTML format for displaying across a line formatted block.
This function converts an element into the appropriate XHTML format for displaying across a line formatted block. The default is <td> for use in XHTML tables. If you change this function, the change will be used for this MetaMapper unless you override the doHtmlLine method.
-
val
displayNameToHeaderElement: (String) ⇒ NodeSeq
This function converts a header name into the appropriate XHTML format for displaying across the headers of a formatted block.
This function converts a header name into the appropriate XHTML format for displaying across the headers of a formatted block. The default is <th> for use in XHTML tables. If you change this function, the change will be used for this MetaMapper unless you override the htmlHeades method
-
lazy val
doAllFieldNames: Seq[(String, SourceFieldMetadata)]
Get a list of all the fields
Get a list of all the fields
- returns
a list of all the fields
- def doHtmlLine(toLine: A): NodeSeq
-
def
doPostCommit(func: () ⇒ Unit): A
Append a function to perform after the commit happens
Append a function to perform after the commit happens
- func
- the function to perform after the commit happens
- Definition Classes
- Mapper
- val elemName: String
-
def
encodeAsJSON_!(toEncode: A): JObject
This method will encode the instance as JSON.
This method will encode the instance as JSON. It may reveal data in fields that might otherwise be proprietary. It should be used with caution and only exposed as a public method after a security review.
- Attributes
- protected
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
fieldByName[T](fieldName: String, actual: A): Box[MappedField[T, A]]
Get a field by the field name
Get a field by the field name
- fieldName
-- the name of the field to get
- actual
-- the instance to get the field on
- returns
Box[The Field] (Empty if the field is not found)
-
def
fieldByName[T](fieldName: String): Box[MappedField[T, A]]
Find the field by name
Find the field by name
- fieldName
-- the name of the field to find
- returns
Box[MappedField]
- Definition Classes
- Mapper
-
def
fieldMapperTransforms(fieldHtml: (BaseOwnedMappedField[A]) ⇒ NodeSeq, mappedObject: A): Seq[CssSel]
A set of CssSels that can be used to bind this MetaMapper's fields.
A set of CssSels that can be used to bind this MetaMapper's fields.
Elements with a class matching the field name are mapped to the NodeSeq produced by the fieldHtml function that is passed in.
So, with a MetaMapper that has three fields, name, date, and description, the resulting CSS selector transforms are:
Seq( ".name" #> fieldHtml(-name field-), ".date" #> fieldHtml(-date field-), ".description" #> fieldHtml(-description field-) )
Above, -name field-, -date field-, and -description field- refer to the actual MappedField objects for those fields.
-
def
fieldMapperTransforms(fieldTransform: (BaseOwnedMappedField[A]) ⇒ NodeSeq): Seq[CssSel]
Given a function that takes a mapper field and returns a NodeSeq for the field, return, for this mapper instance, a set of CSS selector transforms that will transform a form for those fields into a fully-bound form that will interact with this instance.
Given a function that takes a mapper field and returns a NodeSeq for the field, return, for this mapper instance, a set of CSS selector transforms that will transform a form for those fields into a fully-bound form that will interact with this instance.
- Definition Classes
- Mapper
-
lazy val
fieldMatcher: PartialFunction[(A, String), MappedField[Any, A]]
A partial function that takes an instance of A and a field name and returns the mapped field
-
lazy val
fieldNamesAsMap: Map[String, SourceFieldMetadata]
Get a list of all the fields as a map
Get a list of all the fields as a map
- returns
a list of all the fields
- def fieldOrder: List[BaseOwnedMappedField[A]]
- implicit def fieldToItem[T](in: MappedField[T, A]): IndexItem[A]
-
def
fieldTransforms: Seq[CssSel]
A list of CSS selector transforms that will help render the fields of this mapper object.
A list of CSS selector transforms that will help render the fields of this mapper object.
- Definition Classes
- Mapper
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def findAll(by: QueryParam[A]*): List[A]
- def findAll(): List[A]
- def findAllByInsecureSql(query: String, checkedBy: IHaveValidatedThisSQL): List[A]
- def findAllByInsecureSqlDb(dbId: ConnectionIdentifier, query: String, checkedBy: IHaveValidatedThisSQL): List[A]
- def findAllByPreparedStatement(dbId: ConnectionIdentifier, stmt: PreparedStatement): List[A]
-
def
findAllByPreparedStatement(f: (SuperConnection) ⇒ PreparedStatement): List[A]
Execute a PreparedStatement and return a List of Mapper instances.
Execute a PreparedStatement and return a List of Mapper instances.
f
is where the user will do the work of creating the PreparedStatement and preparing it for execution.- f
A function that takes a SuperConnection and returns a PreparedStatement.
- returns
A List of Mapper instances.
- def findAllByPreparedStatementDb[T](dbId: ConnectionIdentifier, stmt: PreparedStatement)(f: (A) ⇒ Box[T]): List[T]
- def findAllDb(dbId: ConnectionIdentifier, by: QueryParam[A]*): List[A]
- def findAllDb(dbId: ConnectionIdentifier): List[A]
- def findAllFields(fields: Seq[SelectableField], by: QueryParam[A]*): List[A]
- def findAllFieldsDb(dbId: ConnectionIdentifier, fields: Seq[SelectableField], by: QueryParam[A]*): List[A]
-
def
findApplier(name: String, inst: AnyRef): Box[(A, AnyRef) ⇒ Unit]
- Attributes
- protected
- def findMap[T](by: QueryParam[A]*)(f: (A) ⇒ Box[T]): List[T]
- def findMapByInsecureSql[T](query: String, checkedBy: IHaveValidatedThisSQL)(f: (A) ⇒ Box[T]): List[T]
- def findMapByInsecureSqlDb[T](dbId: ConnectionIdentifier, query: String, checkedBy: IHaveValidatedThisSQL)(f: (A) ⇒ Box[T]): List[T]
- def findMapDb[T](dbId: ConnectionIdentifier, by: QueryParam[A]*)(f: (A) ⇒ Box[T]): List[T]
- def findMapFieldDb[T](dbId: ConnectionIdentifier, fields: Seq[SelectableField], by: QueryParam[A]*)(f: (A) ⇒ Box[T]): List[T]
-
def
findSourceField(name: String): Box[SourceFieldInfo]
Given a name, look up the field
Given a name, look up the field
- name
the name of the field
- returns
the metadata
- Definition Classes
- Mapper → SourceInfo
-
def
flatMapFieldTitleForm[T](toMap: A, func: (NodeSeq, Box[NodeSeq], NodeSeq) ⇒ Seq[T]): List[T]
flat map the fields titles and forms to generate a list
flat map the fields titles and forms to generate a list
- func
called with displayHtml, fieldId, form
-
def
flatMapFieldTitleForm[T](func: (NodeSeq, Box[NodeSeq], NodeSeq) ⇒ Seq[T]): List[T]
flat map the fields titles and forms to generate a list
flat map the fields titles and forms to generate a list
- func
called with displayHtml, fieldId, form
- Definition Classes
- Mapper
-
def
flatMapFieldTitleForm2[T](toMap: A, func: (NodeSeq, MappedField[_, A], NodeSeq) ⇒ Seq[T]): List[T]
flat map the fields titles and forms to generate a list
flat map the fields titles and forms to generate a list
- func
called with displayHtml, fieldId, form
-
def
flatMapFieldTitleForm2[T](func: (NodeSeq, MappedField[_, A], NodeSeq) ⇒ Seq[T]): List[T]
flat map the fields titles and forms to generate a list
flat map the fields titles and forms to generate a list
- func
called with displayHtml, fieldId, form
- Definition Classes
- Mapper
-
def
formFields(toMap: A): List[MappedField[_, A]]
Get the fields (in order) for displaying a form
-
def
formFields: List[MappedField[_, A]]
Get the fields (in order) for displaying a form
Get the fields (in order) for displaying a form
- Definition Classes
- Mapper
-
val
formatFormElement: (NodeSeq, NodeSeq) ⇒ NodeSeq
This function converts a name and form for a given field in the model to XHTML for presentation in the browser.
This function converts a name and form for a given field in the model to XHTML for presentation in the browser. By default, a table row ( <tr> ) is presented, but you can change the function to display something else.
- def formatFormLine(displayName: NodeSeq, form: NodeSeq): NodeSeq
-
def
getActualBaseField(actual: A, protoField: BaseOwnedMappedField[A]): BaseOwnedMappedField[A]
Given the prototype field (the field on the Singleton), get the field from the instance
Given the prototype field (the field on the Singleton), get the field from the instance
- actual
-- the Mapper instance
- protoField
-- the field from the MetaMapper (Singleton)
- returns
the field from the actual object
-
def
getActualField[T](actual: A, protoField: MappedField[T, A]): MappedField[T, A]
Given the prototype field (the field on the Singleton), get the field from the instance
Given the prototype field (the field on the Singleton), get the field from the instance
- actual
-- the Mapper instance
- protoField
-- the field from the MetaMapper (Singleton)
- returns
the field from the actual object
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- def htmlHeaders: NodeSeq
-
def
htmlLine: NodeSeq
- Definition Classes
- Mapper
- def indexedField(toSave: A): Box[MappedField[Any, A]]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
localeField: Box[MappedLocale[A]]
If there's a field in this record that defines the locale, return it
If there's a field in this record that defines the locale, return it
- Definition Classes
- Mapper
-
def
mapFieldTitleForm[T](toMap: A, func: (NodeSeq, Box[NodeSeq], NodeSeq) ⇒ T): List[T]
map the fields titles and forms to generate a list
map the fields titles and forms to generate a list
- func
called with displayHtml, fieldId, form
-
def
mapFieldTitleForm[T](func: (NodeSeq, Box[NodeSeq], NodeSeq) ⇒ T): List[T]
map the fields titles and forms to generate a list
map the fields titles and forms to generate a list
- func
called with displayHtml, fieldId, form
- Definition Classes
- Mapper
-
lazy val
mappedFields: Seq[BaseMappedField]
The mapped fields
The mapped fields
- Definition Classes
- MetaMapper → BaseMetaMapper
-
lazy val
mappedFieldsForModel: List[MappedField[_, A]]
the mapped fields as MappedField rather than BaseMappedField
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
prependFieldTransform(transform: CssSel): Unit
- Definition Classes
- Mapper
-
val
rootClass: Class[?0] forSome {type ?0 <: MetaMapper[A] with A, type ?0 >: ?0}
- Attributes
- protected
-
def
runSafe[T](f: ⇒ T): T
- Definition Classes
- Mapper
-
def
runValidationList(toValidate: A): List[FieldError]
Run the list of field validations, etc.
Run the list of field validations, etc. This is the raw validation, without the notifications. This method can be over-ridden.
- Attributes
- protected
-
final
def
safe_?: Boolean
- Definition Classes
- Mapper
- def save(toSave: A): Boolean
-
def
save(): Boolean
- Definition Classes
- Mapper → BaseMapper
-
def
saveMe(): A
Save the instance and return the instance
Save the instance and return the instance
- Definition Classes
- Mapper
- def saved_?(toSave: A): Boolean
-
def
saved_?: Boolean
- Definition Classes
- Mapper
-
def
suplementalJs(ob: Box[KeyObfuscator]): List[(String, JsExp)]
If the instance calculates any additional fields for JSON object, put the calculated fields here
If the instance calculates any additional fields for JSON object, put the calculated fields here
- Definition Classes
- Mapper
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
implicit
def
thisToMappee(in: Mapper[A]): A
- Definition Classes
- Mapper
-
def
timeZoneField: Box[MappedTimeZone[A]]
- Definition Classes
- Mapper
- def toForm(toMap: A): NodeSeq
-
def
toForm(button: Box[String], redoSnippet: (NodeSeq) ⇒ NodeSeq, onSuccess: (A) ⇒ Unit): NodeSeq
- Definition Classes
- Mapper
-
def
toForm(button: Box[String], f: (A) ⇒ Any): NodeSeq
Present the model as a form and execute the function on submission of the form
Present the model as a form and execute the function on submission of the form
- button
- If it's Full, put a submit button on the form with the value of the parameter
- f
- the function to execute on form submission
- returns
the form
- Definition Classes
- Mapper
-
def
toForm(button: Box[String], onSuccess: String): NodeSeq
Present the model as a form and execute the function on submission of the form
Present the model as a form and execute the function on submission of the form
- button
- If it's Full, put a submit button on the form with the value of the parameter
- onSuccess
- redirect to the URL if the model validates, otherwise display the errors
- returns
the form
- Definition Classes
- Mapper
-
def
toHtml(toMap: A): NodeSeq
Present the model as a HTML using the same formatting as toForm
Present the model as a HTML using the same formatting as toForm
- toMap
the instance to generate the HTML for
- returns
the html view of the model
-
def
toHtml: NodeSeq
Present the model as a HTML using the same formatting as toForm
Present the model as a HTML using the same formatting as toForm
- returns
the html view of the model
- Definition Classes
- Mapper
-
def
toString(): String
- Definition Classes
- Mapper → AnyRef → Any
- def toXml(what: A): Elem
-
def
toXml: Elem
- Definition Classes
- Mapper
-
def
updateFromJSON_!(toUpdate: A, json: JObject): A
This method will update the instance from JSON.
This method will update the instance from JSON. It allows for attacks from untrusted JSON as it bypasses normal security. By default, the method is protected. You can write a proxy method to expose the functionality.
- Attributes
- protected
- final def validate(toValidate: A): List[FieldError]
-
def
validate: List[FieldError]
- Definition Classes
- Mapper
-
def
validation: List[(A) ⇒ List[FieldError]]
If there are model-specific validations to perform, override this method and return an additional list of validations to perform
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def whatToSet(toSave: A): String
- object addlQueryParams extends RequestVar[List[QueryParam[A]]]