net.liftweb.mapper.MappedField

trait MappedField

trait MappedField[FieldType, OwnerType <: Mapper[OwnerType]]

 extends TypedField[FieldType] with BaseOwnedMappedField[OwnerType] with FieldIdentifier with PSettableValueHolder[FieldType]


The strongly typed field that's mapped to a column (or many columns) in the database. FieldType is the type of the field and OwnerType is the Owner of the field


Companion: MappedField

Source: MappedField.scala(306)

Direct Known Subclasses

MappedBinary, MappedString, MappedText, MappedEnum, MappedFakeClob, MappedDateTime, MappedInt, MappedDecimal, MappedTime, MappedPassword, MappedBoolean, MappedDate, MappedForeignKey, MappedEnumList, MappedDouble, MappedLong,

 Fields

_toForm.. override def _toForm
Create an input field for the item
Box[NodeSeq]
asHtml.. override def asHtml Node
asJsExp.. abstract def asJsExp JsExp BaseMappedField
asString.. def asString
Return the field name and field value, delimited by an '='
String
calcFieldName.. def calcFieldName String
dbAutogenerated_?.. def dbAutogenerated_?
Is the primary key autogenerated
Boolean BaseMappedField
dbColumnCount.. def dbColumnCount
The number of database columns that this field represents
Int
dbColumnName.. def dbColumnName String
dbDisplay_?.. def dbDisplay_? Boolean BaseMappedField
dbFieldClass.. abstract def dbFieldClass
What is the real class that corresponds to FieldType
Class[FieldType] TypedField
dbForeignKey_?.. def dbForeignKey_?
Is the field a foreign key reference
Boolean
dbIncludeInForm_?.. def dbIncludeInForm_? Boolean BaseMappedField
dbIndexFieldIndicatesSaved_?.. def dbIndexFieldIndicatesSaved_?
override this method in indexed fields to indicate that the field has been saved
Boolean
dbIndexed_?.. def dbIndexed_?
Should the field be indexed?
Boolean
dbPrimaryKey_?.. def dbPrimaryKey_?
Is the field the table's primary key
Boolean
dbSelectString.. lazy val dbSelectString String
defaultValue.. abstract def defaultValue
The default value for the field
FieldType TypedField
dirty_?.. def dirty_?
Is the field dirty (has it been changed since the record was loaded from the database
Boolean
displayHtml.. def displayHtml NodeSeq BaseMappedField
displayName.. override def displayName
The display name of this field (e [details]
g., "First Name")
String
displayNameHtml.. def displayNameHtml Box[NodeSeq] BaseMappedField
fieldId.. def fieldId
A unique 'id' for the field for form generation
Option[NodeSeq] BaseMappedField
fieldOwner.. abstract def fieldOwner
Return the owner of this field
OwnerType
get.. def get
An alternative getter
FieldType
i_is_!.. protected abstract def i_is_!
The actual value of the field
FieldType
i_was_!.. protected abstract def i_was_!
The value of the field when it was pulled from the DB
FieldType
ignoreField_?.. def ignoreField_?
Should the field be ignored by the OR Mapper?
Boolean
is.. def is
Convert the field to its "context free" type (e [details]
g., String, Int, Long, etc.) If there are no read permissions, the value will be obscured
FieldType
jdbcFriendly.. def jdbcFriendly
Get a JDBC friendly object for the part of this field that maps to the first column in the database
Object
name.. final def name
The name of this field
String
readPermission_?.. def readPermission_?
Given the current execution state, can the field be read?
Boolean
renderJs_?.. def renderJs_? Boolean BaseMappedField
safe_?.. final def safe_?
Are we in "safe" mode (i [details]
e., the value of the field can be read or written without any security checks.)
Boolean
targetSQLType.. abstract def targetSQLType
Get the JDBC SQL Type for this field
Int
toForm.. def toForm
Create an input field for the item
Box[NodeSeq]
toFormAppendedAttributes.. def toFormAppendedAttributes MetaData
uniqueFieldId.. def uniqueFieldId Box[String] FieldIdentifier
validate.. def validate
Validate this field and return a list of Validation Issues
List[FieldError]
was.. def was
What value was the field's value when it was pulled from the DB?
FieldType
writePermission_?.. def writePermission_?
Given the current execution state, can the field be written?
Boolean

 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
actualField.. def actualField(actual : OwnerType)
Get the field that this prototypical field represents [details]
param
actual - the object to find the field on
MappedField[FieldType, OwnerType]
apply.. def apply[Q](v : Q)(implicit view$2 : (Q) => FieldType) OwnerType
asInstanceOf.. final def asInstanceOf[T0] T0 Any
asJs.. def asJs List[(String, JsExp)] BaseMappedField
buildSetActualValue.. abstract def buildSetActualValue(accessor : Method, inst : Object, columnName : String) (OwnerType, Object) => Unit
buildSetBooleanValue.. abstract def buildSetBooleanValue(accessor : Method, columnName : String) (OwnerType, Boolean, Boolean) => Unit
buildSetDateValue.. abstract def buildSetDateValue(accessor : Method, columnName : String) (OwnerType, Date) => Unit
buildSetLongValue.. abstract def buildSetLongValue(accessor : Method, columnName : String) (OwnerType, Long, Boolean) => Unit
buildSetStringValue.. abstract def buildSetStringValue(accessor : Method, columnName : String) (OwnerType, String) => Unit
clone.. protected def clone Object AnyRef
convertToJDBCFriendly.. final def convertToJDBCFriendly(value : FieldType) Object
dbAddedColumn.. def dbAddedColumn
Called when a column has been added to the database via Schemifier
Box[() => Unit]
dbAddedIndex.. def dbAddedIndex
Called when a column has indexed via Schemifier
Box[() => Unit]
dbColumnNames.. def dbColumnNames(in : String) List[String]
dirty_?.. protected def dirty_?(b : Boolean)
Make the field dirty
Unit
doField.. protected def doField(inst : OwnerType, meth : Method, func : PartialFunction[MappedField[FieldType, OwnerType], Unit]) Unit
doneWithSave.. protected[mapper] abstract def doneWithSave
Called after the field is saved to the database
Unit BaseMappedField
eq.. final def eq(arg0 : Object) Boolean AnyRef
equals.. override def equals(other : Any)
Does the "right thing" comparing mapped fields
Boolean
fieldCreatorString.. abstract def fieldCreatorString(dbType : DriverType, colName : String)
Given the driver type, return the string required to create the column in the database
String
fieldCreatorString.. def fieldCreatorString(dbType : DriverType)
Given the driver type, return a list of SQL creation strings for the columns represented by this field
List[String]
finalize.. protected def finalize Unit AnyRef
getClass.. final def getClass Class[Any] AnyRef
getField.. protected def getField(inst : OwnerType, meth : Method) MappedField[FieldType, OwnerType]
hashCode.. def hashCode Int AnyRef
i_obscure_!.. protected abstract def i_obscure_!(in : FieldType)
Obscure the incoming value to a "safe" value (e [details]
g., if there are not enough rights to view the entire social security number 123-45-5678, this method might return ***-**-*678
FieldType
i_set_!.. protected final def i_set_!(value : FieldType) FieldType
isInstanceOf.. final def isInstanceOf[T0] Boolean Any
jdbcFriendly.. abstract def jdbcFriendly(field : String)
Get a JDBC friendly representation of the named field (this is used for MappedFields that correspond to more than 1 column in the database [details]
)
param
field - -- the name of the field being mapped to
Object
ne.. final def ne(arg0 : Object) Boolean AnyRef
notify.. final def notify Unit AnyRef
notifyAll.. final def notifyAll Unit AnyRef
real_convertToJDBCFriendly.. protected abstract def real_convertToJDBCFriendly(value : FieldType) Object
real_i_set_!.. protected abstract def real_i_set_!(value : FieldType)
Must be implemented to store the value of the field
FieldType
resetDirty.. def resetDirty Unit
runFilters.. def runFilters(in : FieldType, filter : List[(FieldType) => FieldType]) FieldType
set.. def set(value : FieldType)
Set the field to the value
FieldType
setFilter.. protected def setFilter
A list of functions that transform the value before it is set [details]
The transformations are also applied before the value is used in a query. Typical applications of this are trimming and/or toLowerCase-ing strings
List[(FieldType) => FieldType]
setFromAny.. abstract def setFromAny(value : Any)
Attempt to figure out what the incoming value is and set the field to that value [details]
Return true if the value could be assigned
FieldType
set_?.. def set_?(value : Box[FieldType])
Set the field to the Box value if the Box is Full
Box[FieldType]
synchronized.. final def synchronized[T0](arg0 : T0) T0 AnyRef
targetSQLType.. def targetSQLType(field : String)
Get the JDBC SQL Type for this field
Int
toString.. override def toString String
update.. def update[Q](v : Q)(implicit view$1 : (Q) => FieldType)
Assignment from the underlying type [details]
It's ugly, but:
field() = new_value
field := new_value
field set new_value
field.set(new_value)
are all the same
Unit
validations.. def validations List[(FieldType) => List[FieldError]]
wait.. final def wait(arg0 : Long) Unit AnyRef
wait.. final def wait Unit AnyRef
wait.. final def wait(arg0 : Long, arg1 : Int) Unit AnyRef
Copyright (c) 2007-2009 Lift Team. All Rights Reserved.