net.liftweb.record.DBMetaRecord

trait DBMetaRecord

trait DBMetaRecord[BaseRecord <: DBRecord[BaseRecord]]

 extends MetaRecord[BaseRecord]




Source: DBMetaRecord.scala(27)

 Fields

createRecord.. abstract def createRecord
Creates a new record
BaseRecord MetaRecord
dbDefaultConnectionIdentifier.. def dbDefaultConnectionIdentifier ConnectionIdentifier
fieldOrder.. def fieldOrder
Defined the order of the fields in this record [details]
return
- a List of Field
List[OwnedField[BaseRecord]] MetaRecord
formTemplate.. var formTemplate
Set this to use your own form template when rendering a Record to a form [details]
This template is any given XHtml that contains three nodes acting as placeholders such as:
  
   <lift:field_label name="firstName"/> - the label for firstName field will be rendered here
   <lift:field name="firstName"/> - the firstName field will be rendered here (typically an input field)
   <lift:field_msg name="firstName"/> - the  will be rendered here hafing the id given by
                                               uniqueFieldId of the firstName field.
  
  
   Example.
  
   Having:
  
   class MyRecord extends Record[MyRecord] {
  
   	def meta = MyRecordMeta
  
   	object firstName extends StringField(this, "John")
  
   }
  
   object MyRecordMeta extends MyRecord with MetaRecord[MyRecord] {
    override def mutable_? = false
   }
  
   ...
  
   val rec = MyRecordMeta.createRecord.firstName("McLoud")
  
   val template =
   <div>
   	<div>
   		<div><lift:field_label name="firstName"/></div>
   		<div><lift:field name="firstName"/></div>
   		<div><lift:field_msg name="firstName"/></div>
   	</div>
   </div>
  
   MyRecordMeta.formTemplate = Full(template)
   rec.toForm((r:MyRecord) => println(r));
  
   
Box[NodeSeq] MetaRecord
mutable_?.. def mutable_?
Specifies if this Record is mutable or not
Boolean MetaRecord
rootClass.. protected val rootClass Class[Any] MetaRecord

 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
afterCommit.. def afterCommit List[(BaseRecord) => Unit]
appendDispatch.. def appendDispatch(func : PartialFunction[Req, (BaseRecord) => Box[LiftResponse]])
Append a DispatchPF function to LiftRules [details]
dispatch. If the partial function id defined for a give Req it will construct a new Record based on the HTTP query string parameters and will pass this Record to the function returned by func parameter.
param
func - - a PartialFunction for associating a request with a user provided function and the proper Record
RulesSeq[PartialFunction] MetaRecord
asInstanceOf.. final def asInstanceOf[T0] T0 Any
asJSON.. def asJSON(inst : BaseRecord)
Returns the JSON representation of inst record [details]
param
inst: - BaseRecord
return
- JsObj
JsObj MetaRecord
clone.. protected def clone Object AnyRef
createWithMutableField.. def createWithMutableField[FieldType](original : BaseRecord, field : Field[FieldType, BaseRecord], newValue : Box[FieldType])
Creates a new record setting the value of the fields from the original object but apply the new value for the specific field [details]
param
- - field the new mutated field
- - the new value of the field
- - original the initial record
BaseRecord MetaRecord
delete_!.. def delete_!(inst : BaseRecord)
Delete the instance from backing store
Boolean
eq.. final def eq(arg0 : Object) Boolean AnyRef
equals.. def equals(arg0 : Any) Boolean AnyRef
fieldByName.. def fieldByName(fieldName : String, inst : BaseRecord)
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[OwnedField[BaseRecord]] MetaRecord
fields.. def fields(rec : BaseRecord)
Obtain the fields for a particlar Record or subclass instance by passing the instance itself [details]
(added 14th August 2009, Tim Perrett)
List[OwnedField[BaseRecord]] MetaRecord
finalize.. protected def finalize Unit AnyRef
foreachCallback.. protected def foreachCallback(inst : BaseRecord, f : (LifecycleCallbacks) => Any) Unit MetaRecord
fromJSON.. def fromJSON(json : String)
Create a record with fields populated with values from the JSON construct [details]
param
json - - The stringified JSON object
return
- Box[BaseRecord]
Box[BaseRecord] MetaRecord
fromReq.. def fromReq(r : Req)
Create a record with fields populated with values from the request [details]
param
req - - The Req to read from
return
- the created record
BaseRecord MetaRecord
getClass.. final def getClass Class[Any] AnyRef
hashCode.. def hashCode Int AnyRef
introspect.. def introspect(rec : BaseRecord, methods : Array[Method])(f : (Method, OwnedField[BaseRecord]) => Any) Unit MetaRecord
isInstanceOf.. final def isInstanceOf[T0] Boolean Any
metaFields.. def metaFields
Renamed from fields() due to a clash with fields() in Record [details]
Use this method to obtain a list of fields defined in the meta companion objects. Possibly a breaking change? (added 14th August 2009, Tim Perrett)
see
- Record
List[OwnedField[BaseRecord]] MetaRecord
ne.. final def ne(arg0 : Object) Boolean AnyRef
notify.. final def notify Unit AnyRef
notifyAll.. final def notifyAll Unit AnyRef
prependDispatch.. def prependDispatch(func : PartialFunction[Req, (BaseRecord) => Box[LiftResponse]])
Prepend a DispatchPF function to LiftRules [details]
dispatch. If the partial function id defined for a give Req it will construct a new Record based on the HTTP query string parameters and will pass this Record to the function returned by func parameter.
param
func - - a PartialFunction for associating a request with a user provided function and the proper Record
RulesSeq[PartialFunction] MetaRecord
save.. def save(inst : BaseRecord)
Save the instance in the appropriate backing store
Boolean
saved_?.. def saved_?(inst : BaseRecord)
Was this instance saved in backing store?
Boolean
setFieldsFromJSON.. def setFieldsFromJSON(inst : BaseRecord, json : String)
Populate the fields of the record instance with values from the JSON construct [details]
param
json - - The stringified JSON object
inst - - The record to populate
return
- - Full(()) on success, other on failure
Box[Unit] MetaRecord
setFieldsFromReq.. def setFieldsFromReq(inst : BaseRecord, req : Req)
Populate the fields of the record with values from the request [details]
param
req - - The Req to read from
inst - - The record to populate
Box[Unit] MetaRecord
synchronized.. final def synchronized[T0](arg0 : T0) T0 AnyRef
toForm.. def toForm(inst : BaseRecord, template : NodeSeq)
Returns the XHTML representation of inst Record [details]
You must provide the Node template to represent this record in the proprietary layout.
param
template - - The markup template forthe form. See also the formTemplate variable
inst - - the record to be rendered
return
- the XHTML content as a NodeSeq
NodeSeq MetaRecord
toForm.. def toForm(inst : BaseRecord)
Returns the XHTML representation of inst Record [details]
If formTemplate is set, this template will be used otherwise a default template is considered.
param
inst - - the record to be rendered
return
- the XHTML content as a NodeSeq
NodeSeq MetaRecord
toString.. def toString String AnyRef
toXHtml.. def toXHtml(inst : BaseRecord)
Returns the HTML representation of inst Record [details]
param
inst - - th designated Record
return
- a NodeSeq
NodeSeq MetaRecord
validate.. def validate(inst : BaseRecord)
Validates the inst Record by calling validators for each field @pram inst - the Record tobe validated [details]
return
- a List of FieldError. If this list is empty you can assume that record was validated successfully
List[FieldError] MetaRecord
wait.. final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
wait.. final def wait Unit AnyRef
wait.. final def wait(arg0 : Long) Unit AnyRef
Copyright (c) 2006-2010 WorldWide Conferencing, LLC. All Rights Reserved.