net.liftweb.mapper

OneToMany

trait OneToMany[K, T <: KeyedMapper[K, T]] extends KeyedMapper[K, T]

Add this trait to a Mapper for managed one-to-many support For example: class Contact extends LongKeyedMapper[Contact] with OneToMany[Long, Contact] { ... }

K

the type of the primary key

T

the mapper type

Self Type
OneToMany[K, T] with T
Linear Supertypes
KeyedMapper[K, T], BaseKeyedMapper, Mapper[T], Serializable, Serializable, BaseMapper, FieldContainer, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. OneToMany
  2. KeyedMapper
  3. BaseKeyedMapper
  4. Mapper
  5. Serializable
  6. Serializable
  7. BaseMapper
  8. FieldContainer
  9. AnyRef
  10. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. trait Cascade[O <: Mapper[_]] extends (OneToMany.this)#MappedOneToManyBase[O]

    Trait that indicates that the children represented by this field should be deleted when the parent is deleted.

  2. type FieldPF = PartialFunction[String, (NodeSeq) ⇒ NodeSeq]

    Definition Classes
    Mapper
  3. type KeyedMapperType = T

    Definition Classes
    KeyedMapperBaseKeyedMapper
  4. class MappedOneToMany[O <: Mapper[O]] extends (OneToMany.this)#MappedOneToManyBase[O]

    Simple OneToMany support for children from the same table

  5. class MappedOneToManyBase[O <: Mapper[_]] extends Buffer[O]

    This is the base class to use for fields that represent one-to-many or parent-child relationships.

    This is the base class to use for fields that represent one-to-many or parent-child relationships. Maintains a list of children, tracking pending additions and deletions, and keeping their foreign key pointed to this mapper. Implements Buffer, so the children can be managed as one. Most users will use MappedOneToMany, however to support children from multiple tables it is necessary to use MappedOneToManyBase.

  6. type MapperType = T

    Definition Classes
    MapperBaseMapper
  7. trait Owned[O <: Mapper[_]] extends (OneToMany.this)#MappedOneToManyBase[O]

    Adds behavior to delete orphaned fields before save.

  8. type TheKeyType = K

    Definition Classes
    KeyedMapperBaseKeyedMapper

Abstract Value Members

  1. abstract def getSingleton: KeyedMetaMapper[K, T]

    Definition Classes
    KeyedMapperMapper
  2. abstract def primaryKeyField: MappedField[K, T] with IndexedField[K]

    Definition Classes
    KeyedMapperBaseKeyedMapper

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. def allFields: Seq[BaseField]

    Definition Classes
    Mapper → FieldContainer
  5. def appendFieldTransform(transform: CssSel): Unit

    Definition Classes
    Mapper
  6. def asHtml: NodeSeq

    Definition Classes
    Mapper
  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def asJs: JsExp

    Convert the model to a JavaScript object

    Convert the model to a JavaScript object

    Definition Classes
    Mapper
  9. def asSafeJs(f: KeyObfuscator): JsExp

    Definition Classes
    KeyedMapper
  10. def asValid: Box[T]

    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
  11. def checkNames: Unit

    Definition Classes
    Mapper
  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def comparePrimaryKeys(other: T): Boolean

    Definition Classes
    KeyedMapperMapper
  14. def connectionIdentifier: ConnectionIdentifier

    Definition Classes
    Mapper
  15. def connectionIdentifier(id: ConnectionIdentifier): T

    Definition Classes
    Mapper
  16. def countryField: Box[MappedCountry[T]]

    Definition Classes
    Mapper
  17. def dbCalculateConnectionIdentifier: PartialFunction[T, ConnectionIdentifier]

    Definition Classes
    Mapper
  18. def dbName: String

    Definition Classes
    MapperBaseMapper
  19. def db_can_delete_?: Boolean

    Can this model object be deleted?

    Can this model object be deleted?

    Definition Classes
    Mapper
  20. def delete_!: Boolean

    An override for delete_! to propagate the deletion to all children of one-to-many fields implementing Cascade.

    An override for delete_! to propagate the deletion to all children of one-to-many fields implementing Cascade. Returns false as soon as the parent or a one-to-many field returns false. If they are all successful returns true.

    Definition Classes
    OneToManyBaseKeyedMapperMapper
  21. def dirty_?: Boolean

    Definition Classes
    Mapper
  22. def doPostCommit(func: () ⇒ Unit): T

    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
  23. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. def equals(other: Any): Boolean

    Definition Classes
    KeyedMapper → AnyRef → Any
  25. def fieldByName[T](fieldName: String): Box[MappedField[T, T]]

    Find the field by name

    Find the field by name

    fieldName

    -- the name of the field to find

    returns

    Box[MappedField]

    Definition Classes
    Mapper
  26. def fieldMapperTransforms(fieldTransform: (BaseOwnedMappedField[T]) ⇒ NodeSeq): Seq[CssSel]

    Definition Classes
    Mapper
  27. def fieldTransforms: Seq[CssSel]

    Definition Classes
    Mapper
  28. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  29. 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
  30. def flatMapFieldTitleForm2[T](func: (NodeSeq, MappedField[_, T], 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
  31. implicit def foreignKey[K, O <: Mapper[O], T <: KeyedMapper[K, T]](field: MappedForeignKey[K, O, T]): (O) ⇒ MappedForeignKey[K, O, T]

    This implicit allows a MappedForeignKey to be used as foreignKey function.

    This implicit allows a MappedForeignKey to be used as foreignKey function. Returns a function that takes a Mapper and looks up the actualField of field on the Mapper.

  32. def formFields: List[MappedField[_, T]]

    Get the fields (in order) for displaying a form

    Get the fields (in order) for displaying a form

    Definition Classes
    Mapper
  33. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  34. def hashCode(): Int

    Definition Classes
    KeyedMapper → AnyRef → Any
  35. def htmlLine: NodeSeq

    Definition Classes
    Mapper
  36. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  37. def localeField: Box[MappedLocale[T]]

    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
  38. 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
  39. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  40. final def notify(): Unit

    Definition Classes
    AnyRef
  41. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  42. def prependFieldTransform(transform: CssSel): Unit

    Definition Classes
    Mapper
  43. def reload: T

    Definition Classes
    KeyedMapper
  44. def runSafe[T](f: ⇒ T): T

    Definition Classes
    Mapper
  45. final def safe_?: Boolean

    Definition Classes
    Mapper
  46. def save(): Boolean

    An override for save to propagate the save to all children of this parent.

    An override for save to propagate the save to all children of this parent. Returns false as soon as the parent or a one-to-many field returns false. If they are all successful returns true.

    Definition Classes
    OneToManyMapperBaseMapper
  47. def saveMe(): T

    Save the instance and return the instance

    Save the instance and return the instance

    Definition Classes
    Mapper
  48. def saved_?: Boolean

    Definition Classes
    Mapper
  49. 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
  50. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  51. implicit def thisToMappee(in: Mapper[T]): T

    Definition Classes
    Mapper
  52. def timeZoneField: Box[MappedTimeZone[T]]

    Definition Classes
    Mapper
  53. def toForm(button: Box[String], redoSnippet: (NodeSeq) ⇒ NodeSeq, onSuccess: (T) ⇒ Unit): NodeSeq

    Definition Classes
    Mapper
  54. def toForm(button: Box[String], f: (T) ⇒ 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
  55. 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
  56. 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
  57. def toString(): String

    Definition Classes
    Mapper → AnyRef → Any
  58. def toXml: Elem

    Definition Classes
    Mapper
  59. def validate: List[FieldError]

    Definition Classes
    Mapper
  60. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  62. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Deprecated Value Members

  1. def appendField(pf: (OneToMany.this)#FieldPF): Unit

    Definition Classes
    Mapper
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6) Use appendFieldTransform with CssSels instead.

  2. def fieldMapperPF(transform: (BaseOwnedMappedField[T]) ⇒ NodeSeq): (OneToMany.this)#FieldPF

    Definition Classes
    Mapper
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6) Use fieldMapperTransforms with CssSels instead.

  3. def fieldPF: (OneToMany.this)#FieldPF

    Definition Classes
    Mapper
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6) Use fieldTransforms with CssSels instead.

  4. def prependField(pf: (OneToMany.this)#FieldPF): Unit

    Definition Classes
    Mapper
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6) Use prependFieldTransform with CssSels instead.

Inherited from KeyedMapper[K, T]

Inherited from BaseKeyedMapper

Inherited from Mapper[T]

Inherited from Serializable

Inherited from Serializable

Inherited from BaseMapper

Inherited from FieldContainer

Inherited from AnyRef

Inherited from Any

Ungrouped