net.liftweb.mapper.KeyedMetaMapper

trait KeyedMetaMapper

trait KeyedMetaMapper[Type, A <: KeyedMapper[Type, A]]

 extends MetaMapper[A] with KeyedMapper[Type, A]




Source: MetaMapper.scala(1289)

Direct Known Subclasses

LongKeyedMetaMapper, MetaProtoExtendedSession, MetaMegaProtoUser, CRUDify, MetaProtoTag,

 Fields

addSnippetSetup def addSnippetSetup
Default setup behavior for the add snippet [details]
Creates a new mapped object.
return
- new mapped object
A
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 MetaMapper
columnQueriesForInsert val columnQueriesForInsert String MetaMapper
connectionIdentifier def connectionIdentifier ConnectionIdentifier Mapper
count def count Long MetaMapper
countryField def countryField Box[MappedCountry[A]] Mapper
create def create A MetaMapper
createInstance def createInstance A MetaMapper
crudSnippets def crudSnippets
Defines the default CRUD snippets [details]
Override if you want to change the names of the snippets. Defaults are "add", "edit", and "view". (No, there's no D in CRUD.)
PartialFunction
crudSnippets_? def crudSnippets_?
Override this definition in your model to enable CRUD snippets for that model [details]
Set to false by default. Remember to override editSnippetSetup and viewSnippetSetup as well, as the defaults are broken.
return
- false
Boolean
dbCalculateConnectionIdentifier def dbCalculateConnectionIdentifier PartialFunction[A, ConnectionIdentifier] Mapper
dbDefaultConnectionIdentifier def dbDefaultConnectionIdentifier ConnectionIdentifier MetaMapper
dbIndexes def dbIndexes List[Index[A]] MetaMapper
dbSelectDBConnectionForFind def dbSelectDBConnectionForFind PartialFunction[Type, ConnectionIdentifier]
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 MetaMapper
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 MetaMapper
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 MetaMapper
editSnippetSetup def editSnippetSetup
Default setup behavior for the edit snippet [details]
BROKEN! MUST OVERRIDE IF USING CRUD SNIPPETS!
return
- a mapped object of this metamapper's type
A
elemName val elemName String MetaMapper
fieldMatcher lazy val fieldMatcher PartialFunction[(A, String), MappedField[Any, A]] MetaMapper
fieldOrder def fieldOrder List[BaseOwnedMappedField[A]] MetaMapper
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 MetaMapper
getSingleton abstract def getSingleton KeyedMetaMapper[KeyType, OwnerType] KeyedMapper
htmlHeaders def htmlHeaders NodeSeq MetaMapper
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] MetaMapper
objFromIndexedParam def objFromIndexedParam
Lame attempt at automatically getting an object from the HTTP parameters [details]
BROKEN! DO NOT USE! Only here so that existing sub-classes KeyedMetaMapper don't have to implement new methods when I commit the CRUD snippets code.
Box[A]
primaryKeyField abstract def primaryKeyField MappedField[KeyType, OwnerType] with IndexedField[KeyType] KeyedMapper
reload def reload OwnerType KeyedMapper
rootClass protected val rootClass Class[Any] MetaMapper
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
viewSnippetSetup def viewSnippetSetup
Default setup behavior for the view snippet [details]
BROKEN! MUST OVERRIDE IF USING CRUD SNIPPETS!
return
- a mapped object of this metamapper's type
A

 Methods

!= final def !=(arg0 : Object) Boolean AnyRef
!= final def !=(arg0 : Any) Boolean Any
== final def ==(arg0 : Any) Boolean Any
== final def ==(arg0 : Object) Boolean AnyRef
addEndStuffs def addEndStuffs(in : String, params : List[QueryParam[A]], conn : SuperConnection) (String, Box[Long], Box[Long]) MetaMapper
addSnippet def addSnippet(xhtml : NodeSeq)
Default add snippet [details]
Override to change behavior of the add snippet.
NodeSeq
addSnippetCallback def addSnippetCallback(obj : A)
Default callback behavior of the add snippet [details]
Called when the user presses submit. Saves the passed in object.
param
obj - mapped object of this metamapper's type
Unit
afterCommit def afterCommit List[(A) => Unit] MetaMapper
afterCreate def afterCreate List[(A) => Any] MetaMapper
afterDelete def afterDelete List[(A) => Any] MetaMapper
afterSave def afterSave List[(A) => Any] MetaMapper
afterSchemifier override def afterSchemifier Unit
afterUpdate def afterUpdate List[(A) => Any] MetaMapper
afterValidation def afterValidation List[(A) => Any] MetaMapper
afterValidationOnCreate def afterValidationOnCreate List[(A) => Any] MetaMapper
afterValidationOnUpdate def afterValidationOnUpdate List[(A) => Any] MetaMapper
appendField def appendField(pf : PartialFunction) Unit Mapper
appendFieldToStrings def appendFieldToStrings(in : A) String MetaMapper
asHtml def asHtml(toLine : A) NodeSeq MetaMapper
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 MetaMapper
asJs def asJs(actual : A) JsExp MetaMapper
asSafeJs def asSafeJs(f : KeyObfuscator) JsExp KeyedMapper
asSafeJs def asSafeJs(actual : A, f : KeyObfuscator) JsExp
beforeCreate def beforeCreate List[(A) => Any] MetaMapper
beforeDelete def beforeDelete List[(A) => Any] MetaMapper
beforeSave def beforeSave List[(A) => Any] MetaMapper
beforeSchemifier def beforeSchemifier Unit MetaMapper
beforeUpdate def beforeUpdate List[(A) => Any] MetaMapper
beforeValidation def beforeValidation List[(A) => Any] MetaMapper
beforeValidationOnCreate def beforeValidationOnCreate List[(A) => Any] MetaMapper
beforeValidationOnUpdate def beforeValidationOnUpdate List[(A) => Any] MetaMapper
boundedFieldToItem implicit def boundedFieldToItem(in : (MappedField[String, A], Int)) BoundedIndexField[A] MetaMapper
buildMapper def buildMapper(rs : ResultSet) (Int, Array[(ResultSet, Int, A) => Unit]) MetaMapper
bulkDelete_!! def bulkDelete_!!(dbId : ConnectionIdentifier, by : QueryParam[A]*) Boolean MetaMapper
bulkDelete_!! def bulkDelete_!!(by : QueryParam[A]*) Boolean MetaMapper
checkFieldNames def checkFieldNames(in : A) Unit MetaMapper
checkNames def checkNames Unit Mapper
clean_? def clean_?(toCheck : A)
Returns true if none of the fields are dirty
Boolean MetaMapper
clone protected def clone Object AnyRef
columnPrimaryKey_? def columnPrimaryKey_?(name : String) Boolean MetaMapper
comparePrimaryKeys override def comparePrimaryKeys(other : OwnerType) Boolean KeyedMapper
connectionIdentifier def connectionIdentifier(id : ConnectionIdentifier) A Mapper
count def count(by : QueryParam[A]*) Long MetaMapper
countByInsecureSql def countByInsecureSql(query : String, checkedBy : IHaveValidatedThisSQL) Long MetaMapper
countByInsecureSqlDb def countByInsecureSqlDb(dbId : ConnectionIdentifier, query : String, checkedBy : IHaveValidatedThisSQL) Long MetaMapper
countDb def countDb(dbId : ConnectionIdentifier, by : QueryParam[A]*) Long MetaMapper
createInstance def createInstance(dbId : ConnectionIdentifier, rs : ResultSet, colCnt : Int, mapFuncs : Array[(ResultSet, Int, A) => Unit]) A MetaMapper
createInstances def createInstances(dbId : ConnectionIdentifier, rs : ResultSet, start : Box[Long], omax : Box[Long]) List[A] MetaMapper
createInstances def createInstances[T](dbId : ConnectionIdentifier, rs : ResultSet, start : Box[Long], omax : Box[Long], f : (A) => Box[T]) List[T] MetaMapper
dbAddTable def dbAddTable Box[() => Unit] MetaMapper
dbStringToKey def dbStringToKey(in : String) Box[Type]
delete_! def delete_!(toDelete : A) Boolean MetaMapper
dirty_? def dirty_?(toTest : A) Boolean MetaMapper
doHtmlLine def doHtmlLine(toLine : A) NodeSeq MetaMapper
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
editSnippet def editSnippet(xhtml : NodeSeq)
Default edit snippet [details]
Override to change behavior of the edit snippet.
NodeSeq
editSnippetCallback def editSnippetCallback(obj : A)
Default callback behavior of the edit snippet [details]
Called when the user presses submit. Saves the passed in object.
param
obj - mapped object of this metamapper's type
Unit
eq final def eq(arg0 : Object) Boolean AnyRef
equals override def equals(other : Any) Boolean KeyedMapper
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
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]] MetaMapper
fieldMapperPF def fieldMapperPF(transform : (BaseOwnedMappedField[A]) => NodeSeq, actual : A) PartialFunction[String, (NodeSeq) => NodeSeq] MetaMapper
fieldMapperPF def fieldMapperPF(transform : (BaseOwnedMappedField[A]) => NodeSeq) PartialFunction Mapper
fieldToItem implicit def fieldToItem[T](in : MappedField[T, A]) IndexItem[A] MetaMapper
finalize protected def finalize Unit AnyRef
find def find(key : String) Box[A]
find def find(by : QueryParam[A]*) Box[A]
find def find(key : Any) Box[A]
find def find(dbId : ConnectionIdentifier, key : String) Box[A]
findAll def findAll(by : QueryParam[A]*) List[A] MetaMapper
findAll def findAll List[A] MetaMapper
findAllByInsecureSql def findAllByInsecureSql(query : String, checkedBy : IHaveValidatedThisSQL) List[A] MetaMapper
findAllByInsecureSqlDb def findAllByInsecureSqlDb(dbId : ConnectionIdentifier, query : String, checkedBy : IHaveValidatedThisSQL) List[A] MetaMapper
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] MetaMapper
findAllByPreparedStatement def findAllByPreparedStatement(dbId : ConnectionIdentifier, stmt : PreparedStatement) List[A] MetaMapper
findAllByPreparedStatementDb def findAllByPreparedStatementDb[T](dbId : ConnectionIdentifier, stmt : PreparedStatement)(f : (A) => Box[T]) List[T] MetaMapper
findAllDb def findAllDb(dbId : ConnectionIdentifier, by : QueryParam[A]*) List[A] MetaMapper
findAllDb def findAllDb(dbId : ConnectionIdentifier) List[A] MetaMapper
findAllFields def findAllFields(fields : Seq[SelectableField], by : QueryParam[A]*) List[A] MetaMapper
findAllFieldsDb def findAllFieldsDb(dbId : ConnectionIdentifier, fields : Seq[SelectableField], by : QueryParam[A]*) List[A] MetaMapper
findApplier protected def findApplier(name : String, inst : Object) Box[(A, Object) => Unit] MetaMapper
findByKey def findByKey(key : Type) Box[A]
findDb def findDb(dbId : ConnectionIdentifier, fields : Seq[SelectableField], by : QueryParam[A]*) Box[A]
findDb def findDb(dbId : ConnectionIdentifier, by : QueryParam[A]*) Box[A]
findDb def findDb(dbId : ConnectionIdentifier, key : Any) Box[A]
findDbByKey def findDbByKey(dbId : ConnectionIdentifier, key : Type) Box[A]
findDbByKey def findDbByKey(dbId : ConnectionIdentifier, fields : Seq[SelectableField], key : Type) Box[A]
findMap def findMap[T](by : QueryParam[A]*)(f : (A) => Box[T]) List[T] MetaMapper
findMapByInsecureSql def findMapByInsecureSql[T](query : String, checkedBy : IHaveValidatedThisSQL)(f : (A) => Box[T]) List[T] MetaMapper
findMapByInsecureSqlDb def findMapByInsecureSqlDb[T](dbId : ConnectionIdentifier, query : String, checkedBy : IHaveValidatedThisSQL)(f : (A) => Box[T]) List[T] MetaMapper
findMapDb def findMapDb[T](dbId : ConnectionIdentifier, by : QueryParam[A]*)(f : (A) => Box[T]) List[T] MetaMapper
findMapFieldDb def findMapFieldDb[T](dbId : ConnectionIdentifier, fields : Seq[SelectableField], by : QueryParam[A]*)(f : (A) => Box[T]) List[T] MetaMapper
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] MetaMapper
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
formFields def formFields(toMap : A)
Get the fields (in order) for displaying a form
List[MappedField[Any, A]] MetaMapper
formatFormLine def formatFormLine(displayName : NodeSeq, form : NodeSeq) NodeSeq MetaMapper
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] MetaMapper
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] MetaMapper
getClass final def getClass Class[Any] AnyRef
hashCode def hashCode Int AnyRef
indexedField def indexedField(toSave : A) Box[MappedField[Any, A]] MetaMapper
isInstanceOf final def isInstanceOf[T0] Boolean Any
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
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] MetaMapper
modSnippet def modSnippet(xhtml : NodeSeq, obj : A, cleanup : (A) => Unit)
Default snippet for modification [details]
Used by the default add and edit snippets.
NodeSeq
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] MetaMapper
save def save(toSave : A) Boolean MetaMapper
save def save Boolean Mapper
saveMe def saveMe
Save the instance and return the instance
A Mapper
saved_? def saved_?(toSave : A) Boolean MetaMapper
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(toMap : A) NodeSeq MetaMapper
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
toForm def toForm(button : Box[String], redoSnippet : (NodeSeq) => NodeSeq, onSuccess : (A) => Unit) NodeSeq Mapper
toString override def toString String Mapper
toXml def toXml(what : A) Elem MetaMapper
validate final def validate(toValidate : A) List[FieldError] MetaMapper
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]] MetaMapper
viewSnippet def viewSnippet(xhtml : NodeSeq)
Default view snippet [details]
Override to change behavior of the view snippet.
NodeSeq
wait final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
wait final def wait Unit AnyRef
wait final def wait(arg0 : Long) Unit AnyRef
whatToSet def whatToSet(toSave : A) String MetaMapper
Copyright (c) 2007-2009 Lift Team. All Rights Reserved.