net.liftweb.mapper.MetaMapper

trait MetaMapper

trait MetaMapper[A <: Mapper[A]]

 extends BaseMetaMapper with Mapper[A]




Source: MetaMapper.scala(82)

Direct Known Subclasses

KeyedMetaMapper,

 Fields

asHtml def asHtml NodeSeq Mapper
asJSON def asJSON
Create a JSON representation of this model object
String Mapper
asJs def asJs
Convert the model to a JavaScript object
JsExp Mapper
columnNamesForInsert val columnNamesForInsert String
columnQueriesForInsert val columnQueriesForInsert String
connectionIdentifier def connectionIdentifier ConnectionIdentifier Mapper
count def count Long
countryField def countryField Box[MappedCountry[A]] Mapper
create def create A
createInstance def createInstance A
dbCalculateConnectionIdentifier def dbCalculateConnectionIdentifier PartialFunction[A, ConnectionIdentifier] Mapper
dbDefaultConnectionIdentifier def dbDefaultConnectionIdentifier ConnectionIdentifier
dbIndexes def dbIndexes List[Index[A]]
dbTableName def dbTableName
The name of the database table [details]
Override this method if you want to change the table to something other than the name of the Mapper class
String
db_can_delete_? def db_can_delete_?
Can this model object be deleted?
Boolean Mapper
delete_! def delete_!
Delete the model from the RDBMS
Boolean Mapper
dirty_? def dirty_? Boolean Mapper
displayFieldAsLineElement var displayFieldAsLineElement
This function converts an element into the appropriate XHTML format for displaying across a line formatted block [details]
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.
(NodeSeq) => NodeSeq
displayNameToHeaderElement var displayNameToHeaderElement
This function converts a header name into the appropriate XHTML format for displaying across the headers of a formatted block [details]
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
(String) => NodeSeq
elemName val elemName String
fieldMatcher lazy val fieldMatcher PartialFunction[(A, String), MappedField[Any, A]]
fieldOrder def fieldOrder List[BaseOwnedMappedField[A]]
fieldPF def fieldPF PartialFunction Mapper
formFields def formFields
Get the fields (in order) for displaying a form
List[MappedField[Any, A]] Mapper
formatFormElement var formatFormElement
This function converts a name and form for a given field in the model to XHTML for presentation in the browser [details]
By default, a table row ( <tr> ) is presented, but you can change the function to display something else.
(NodeSeq, NodeSeq) => NodeSeq
getSingleton abstract def getSingleton MetaMapper[A] Mapper
htmlHeaders def htmlHeaders NodeSeq
htmlLine def htmlLine NodeSeq Mapper
localeField def localeField
If there's a field in this record that defines the locale, return it
Box[MappedLocale[A]] Mapper
mappedFields def mappedFields Seq[BaseMappedField]
rootClass protected val rootClass Class[Any]
safe_? final def safe_? Boolean Mapper
saved_? def saved_? Boolean Mapper
timeZoneField def timeZoneField Box[MappedTimeZone[A]] Mapper
toXml def toXml Elem Mapper
validate def validate List[FieldError] Mapper

 Methods

!= final def !=(arg0 : Any) Boolean Any
!= final def !=(arg0 : Object) Boolean AnyRef
== final def ==(arg0 : Object) Boolean AnyRef
== final def ==(arg0 : Any) Boolean Any
addEndStuffs def addEndStuffs(in : String, params : List[QueryParam[A]], conn : SuperConnection) (String, Box[Long], Box[Long])
afterCommit def afterCommit List[(A) => Unit]
afterCreate def afterCreate List[(A) => Any]
afterDelete def afterDelete List[(A) => Any]
afterSave def afterSave List[(A) => Any]
afterSchemifier def afterSchemifier Unit
afterUpdate def afterUpdate List[(A) => Any]
afterValidation def afterValidation List[(A) => Any]
afterValidationOnCreate def afterValidationOnCreate List[(A) => Any]
afterValidationOnUpdate def afterValidationOnUpdate List[(A) => Any]
appendField def appendField(pf : PartialFunction) Unit Mapper
appendFieldToStrings def appendFieldToStrings(in : A) String
asHtml def asHtml(toLine : A) NodeSeq
asInstanceOf final def asInstanceOf[T0] T0 Any
asJSON def asJSON(sb : StringBuilder)
Append the JSON representation of this model object to the string builder [details]
param
the - string builder to append the JSON representation of this model to
return
- the StringBuilder
StringBuilder Mapper
asJSON def asJSON(actual : A, sb : StringBuilder)
StringBuilder
asJs def asJs(actual : A) JsExp
beforeCreate def beforeCreate List[(A) => Any]
beforeDelete def beforeDelete List[(A) => Any]
beforeSave def beforeSave List[(A) => Any]
beforeSchemifier def beforeSchemifier Unit
beforeUpdate def beforeUpdate List[(A) => Any]
beforeValidation def beforeValidation List[(A) => Any]
beforeValidationOnCreate def beforeValidationOnCreate List[(A) => Any]
beforeValidationOnUpdate def beforeValidationOnUpdate List[(A) => Any]
boundedFieldToItem implicit def boundedFieldToItem(in : (MappedField[String, A], Int)) BoundedIndexField[A]
buildMapper def buildMapper(rs : ResultSet) (Int, Array[(ResultSet, Int, A) => Unit])
bulkDelete_!! def bulkDelete_!!(dbId : ConnectionIdentifier, by : QueryParam[A]*) Boolean
bulkDelete_!! def bulkDelete_!!(by : QueryParam[A]*) Boolean
checkFieldNames def checkFieldNames(in : A) Unit
checkNames def checkNames Unit Mapper
clean_? def clean_?(toCheck : A)
Returns true if none of the fields are dirty
Boolean
clone protected def clone Object AnyRef
columnPrimaryKey_? def columnPrimaryKey_?(name : String) Boolean
comparePrimaryKeys def comparePrimaryKeys(other : A) Boolean Mapper
connectionIdentifier def connectionIdentifier(id : ConnectionIdentifier) A Mapper
count def count(by : QueryParam[A]*) Long
countByInsecureSql def countByInsecureSql(query : String, checkedBy : IHaveValidatedThisSQL) Long
countByInsecureSqlDb def countByInsecureSqlDb(dbId : ConnectionIdentifier, query : String, checkedBy : IHaveValidatedThisSQL) Long
countDb def countDb(dbId : ConnectionIdentifier, by : QueryParam[A]*) Long
createInstance def createInstance(dbId : ConnectionIdentifier, rs : ResultSet, colCnt : Int, mapFuncs : Array[(ResultSet, Int, A) => Unit]) A
createInstances def createInstances(dbId : ConnectionIdentifier, rs : ResultSet, start : Box[Long], omax : Box[Long]) List[A]
createInstances def createInstances[T](dbId : ConnectionIdentifier, rs : ResultSet, start : Box[Long], omax : Box[Long], f : (A) => Box[T]) List[T]
dbAddTable def dbAddTable Box[() => Unit]
delete_! def delete_!(toDelete : A) Boolean
dirty_? def dirty_?(toTest : A) Boolean
doHtmlLine def doHtmlLine(toLine : A) NodeSeq
doPostCommit def doPostCommit(func : () => Unit)
Append a function to perform after the commit happens [details]
param
func - - the function to perform after the commit happens
A Mapper
eq final def eq(arg0 : Object) Boolean AnyRef
equals def equals(arg0 : Any) Boolean AnyRef
fieldByName def fieldByName[T](fieldName : String, actual : A)
Get a field by the field name [details]
param
actual - -- the instance to get the field on
fieldName - -- the name of the field to get
return
- Box[The Field] (Empty if the field is not found)
Box[MappedField[T, A]]
fieldByName def fieldByName[T](fieldName : String)
Find the field by name [details]
param
fieldName - -- the name of the field to find
return
- Box[MappedField]
Box[MappedField[T, A]] Mapper
fieldMapperPF def fieldMapperPF(transform : (BaseOwnedMappedField[A]) => NodeSeq, actual : A) PartialFunction[String, (NodeSeq) => NodeSeq]
fieldMapperPF def fieldMapperPF(transform : (BaseOwnedMappedField[A]) => NodeSeq) PartialFunction Mapper
fieldToItem implicit def fieldToItem[T](in : MappedField[T, A]) IndexItem[A]
finalize protected def finalize Unit AnyRef
findAll def findAll List[A]
findAll def findAll(by : QueryParam[A]*) List[A]
findAllByInsecureSql def findAllByInsecureSql(query : String, checkedBy : IHaveValidatedThisSQL) List[A]
findAllByInsecureSqlDb def findAllByInsecureSqlDb(dbId : ConnectionIdentifier, query : String, checkedBy : IHaveValidatedThisSQL) List[A]
findAllByPreparedStatement def findAllByPreparedStatement(f : (SuperConnection) => PreparedStatement)
Execute a PreparedStatement and return a List of Mapper instances [details]
{@code f} is where the user will do the work of creating the PreparedStatement and preparing it for execution.
param
f - A function that takes a SuperConnection and returns a PreparedStatement.
return
- A List of Mapper instances.
List[A]
findAllByPreparedStatement def findAllByPreparedStatement(dbId : ConnectionIdentifier, stmt : PreparedStatement) List[A]
findAllByPreparedStatementDb def findAllByPreparedStatementDb[T](dbId : ConnectionIdentifier, stmt : PreparedStatement)(f : (A) => Box[T]) List[T]
findAllDb def findAllDb(dbId : ConnectionIdentifier) List[A]
findAllDb def findAllDb(dbId : ConnectionIdentifier, by : QueryParam[A]*) List[A]
findAllFields def findAllFields(fields : Seq[SelectableField], by : QueryParam[A]*) List[A]
findAllFieldsDb def findAllFieldsDb(dbId : ConnectionIdentifier, fields : Seq[SelectableField], by : QueryParam[A]*) List[A]
findApplier protected def findApplier(name : String, inst : Object) Box[(A, Object) => Unit]
findMap def findMap[T](by : QueryParam[A]*)(f : (A) => Box[T]) List[T]
findMapByInsecureSql def findMapByInsecureSql[T](query : String, checkedBy : IHaveValidatedThisSQL)(f : (A) => Box[T]) List[T]
findMapByInsecureSqlDb def findMapByInsecureSqlDb[T](dbId : ConnectionIdentifier, query : String, checkedBy : IHaveValidatedThisSQL)(f : (A) => Box[T]) List[T]
findMapDb def findMapDb[T](dbId : ConnectionIdentifier, by : QueryParam[A]*)(f : (A) => Box[T]) List[T]
findMapFieldDb def findMapFieldDb[T](dbId : ConnectionIdentifier, fields : Seq[SelectableField], by : QueryParam[A]*)(f : (A) => Box[T]) List[T]
flatMapFieldTitleForm def flatMapFieldTitleForm[T](func : (NodeSeq, Box[NodeSeq], NodeSeq) => Seq[T])
flat map the fields titles and forms to generate a list [details]
param
func - called with displayHtml, fieldId, form
List[T] Mapper
flatMapFieldTitleForm def flatMapFieldTitleForm[T](toMap : A, func : (NodeSeq, Box[NodeSeq], NodeSeq) => Seq[T])
flat map the fields titles and forms to generate a list [details]
param
func - called with displayHtml, fieldId, form
List[T]
formFields def formFields(toMap : A)
Get the fields (in order) for displaying a form
List[MappedField[Any, A]]
formatFormLine def formatFormLine(displayName : NodeSeq, form : NodeSeq) NodeSeq
getActualBaseField def getActualBaseField(actual : A, protoField : BaseOwnedMappedField[A])
Given the prototype field (the field on the Singleton), get the field from the instance [details]
param
protoField - -- the field from the MetaMapper (Singleton)
actual - -- the Mapper instance
return
- the field from the actual object
BaseOwnedMappedField[A]
getActualField def getActualField[T](actual : A, protoField : MappedField[T, A])
Given the prototype field (the field on the Singleton), get the field from the instance [details]
param
protoField - -- the field from the MetaMapper (Singleton)
actual - -- the Mapper instance
return
- the field from the actual object
MappedField[T, A]
getClass final def getClass Class[Any] AnyRef
hashCode def hashCode Int AnyRef
indexedField def indexedField(toSave : A) Box[MappedField[Any, A]]
isInstanceOf final def isInstanceOf[T0] Boolean Any
mapFieldTitleForm def mapFieldTitleForm[T](toMap : A, func : (NodeSeq, Box[NodeSeq], NodeSeq) => T)
map the fields titles and forms to generate a list [details]
param
func - called with displayHtml, fieldId, form
List[T]
mapFieldTitleForm def mapFieldTitleForm[T](func : (NodeSeq, Box[NodeSeq], NodeSeq) => T)
map the fields titles and forms to generate a list [details]
param
func - called with displayHtml, fieldId, form
List[T] Mapper
ne final def ne(arg0 : Object) Boolean AnyRef
notify final def notify Unit AnyRef
notifyAll final def notifyAll Unit AnyRef
prependField def prependField(pf : PartialFunction) Unit Mapper
runSafe def runSafe[T](f : => T) T Mapper
runValidationList protected def runValidationList(toValidate : A)
Run the list of field validations, etc [details]
This is the raw validation, without the notifications. This method can be over-ridden.
List[FieldError]
save def save(toSave : A) Boolean
save def save Boolean Mapper
saveMe def saveMe
Save the instance and return the instance
A Mapper
saved_? def saved_?(toSave : A) Boolean
suplementalJs def suplementalJs(ob : Box[KeyObfuscator])
If the instance calculates any additional fields for JSON object, put the calculated fields here
List[(String, JsExp)] Mapper
synchronized final def synchronized[T0](arg0 : T0) T0 AnyRef
thisToMappee implicit def thisToMappee(in : Mapper[A]) A Mapper
toForm def toForm(button : Box[String], redoSnippet : (NodeSeq) => NodeSeq, onSuccess : (A) => Unit) NodeSeq Mapper
toForm def toForm(toMap : A) NodeSeq
toForm def toForm(button : Box[String], f : (A) => Any)
Present the model as a form and execute the function on submission of the form [details]
param
f - - the function to execute on form submission
button - - If it's Full, put a submit button on the form with the value of the parameter
return
- the form
NodeSeq Mapper
toForm def toForm(button : Box[String], onSuccess : String)
Present the model as a form and execute the function on submission of the form [details]
param
onSuccess - - redirect to the URL if the model validates, otherwise display the errors
button - - If it's Full, put a submit button on the form with the value of the parameter
return
- the form
NodeSeq Mapper
toString override def toString String Mapper
toXml def toXml(what : A) Elem
validate final def validate(toValidate : A) List[FieldError]
validation def validation
If there are model-specific validations to perform, override this method and return an additional list of validations to perform
List[(A) => List[FieldError]]
wait final def wait Unit AnyRef
wait final def wait(arg0 : Long) Unit AnyRef
wait final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
whatToSet def whatToSet(toSave : A) String
Copyright (c) 2007-2009 Lift Team. All Rights Reserved.