Packages

t

molecule.factory

Composite_Factory

trait Composite_Factory extends AnyRef

Implicit composite molecule factory methods of arity 1-22.

Composite molecules model entities with attributes from different namespaces that are not necessarily related. Each group of attributes is modelled by a molecule and these "sub-molecules" are tied together with ~ methods to form a composite molecule.

For brevity, only arity 1 and 2 method signatures are shown. Arity 3-22 follow the same pattern.

Source
Composite_Factory.scala
See also

Manual | Tests

Linear Supertypes
AnyRef, Any
Known Subclasses
Type Hierarchy
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. Composite_Factory
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. implicit macro def m[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22](dsl: Composite22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22]): Molecule22[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22]
  13. implicit macro def m[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21](dsl: Composite21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21]): Molecule21[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21]
  14. implicit macro def m[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20](dsl: Composite20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20]): Molecule20[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20]
  15. implicit macro def m[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19](dsl: Composite19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19]): Molecule19[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19]
  16. implicit macro def m[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18](dsl: Composite18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18]): Molecule18[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18]
  17. implicit macro def m[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17](dsl: Composite17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17]): Molecule17[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17]
  18. implicit macro def m[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16](dsl: Composite16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]): Molecule16[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]
  19. implicit macro def m[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15](dsl: Composite15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]): Molecule15[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]
  20. implicit macro def m[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14](dsl: Composite14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]): Molecule14[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]
  21. implicit macro def m[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13](dsl: Composite13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]): Molecule13[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]
  22. implicit macro def m[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12](dsl: Composite12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]): Molecule12[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]
  23. implicit macro def m[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11](dsl: Composite11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]): Molecule11[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]
  24. implicit macro def m[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10](dsl: Composite10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]): Molecule10[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]
  25. implicit macro def m[T1, T2, T3, T4, T5, T6, T7, T8, T9](dsl: Composite09[T1, T2, T3, T4, T5, T6, T7, T8, T9]): Molecule09[T1, T2, T3, T4, T5, T6, T7, T8, T9]
  26. implicit macro def m[T1, T2, T3, T4, T5, T6, T7, T8](dsl: Composite08[T1, T2, T3, T4, T5, T6, T7, T8]): Molecule08[T1, T2, T3, T4, T5, T6, T7, T8]
  27. implicit macro def m[T1, T2, T3, T4, T5, T6, T7](dsl: Composite07[T1, T2, T3, T4, T5, T6, T7]): Molecule07[T1, T2, T3, T4, T5, T6, T7]
  28. implicit macro def m[T1, T2, T3, T4, T5, T6](dsl: Composite06[T1, T2, T3, T4, T5, T6]): Molecule06[T1, T2, T3, T4, T5, T6]
  29. implicit macro def m[T1, T2, T3, T4, T5](dsl: Composite05[T1, T2, T3, T4, T5]): Molecule05[T1, T2, T3, T4, T5]
  30. implicit macro def m[T1, T2, T3, T4](dsl: Composite04[T1, T2, T3, T4]): Molecule04[T1, T2, T3, T4]
  31. implicit macro def m[T1, T2, T3](dsl: Composite03[T1, T2, T3]): Molecule03[T1, T2, T3]
  32. implicit macro def m[T1, T2](dsl: Composite02[T1, T2]): Molecule02[T1, T2]

    Macro creation of composite molecule from user-defined DSL structure with 2 output groups.

    Macro creation of composite molecule from user-defined DSL structure with 2 output groups.

    The builder pattern is used to add one or more attributes to an initial namespace like Person from the example below. Further non-related attributes can be tied together with the ~ method to form "composite molecules" that is basically just attributes sharing the same entity id.

    Once the composite molecule models the desired data structure we can call various actions on it, like get that retrieves matching data from the database.

    // Explicitly calling `m` to create composite molecule with 2 output attributes
    m(Person.name ~ Tag.score).get.head === ("Ben", 7)
    
    // Alternatively we can create the composite molecule implicitly
    Person.name.~(Tag.score).get.head === ("Ben", 7)

    Composite molecules of arity 2 has two sub-molecules with output attribute(s). If a sub-molecule has multiple output attributes, a tuple is returned, otherwise just the single value. The two groups of either a single type or tuple are then tied together in an outer composite tuple:

    Composite molecule          Composite type (2 output groups)
    
    A.a1    ~ B.b1        =>    (a1, b1)
    A.a1    ~ B.b1.b2     =>    (a1, (b1, b2))
    A.a1.a2 ~ B.b1        =>    ((a1, a2), b1)
    A.a1.a2 ~ B.b1.b2     =>    ((a1, a2), (b1, b2)) etc...
    
    We could even have additional non-output sub-molecules:
    A.a1.a2 ~ B.b1.b2 ~ C.c1_     =>    ((a1, a2), (b1, b2)) etc...

    Translating into the example:

    m(Person.name ~ Tag.score.flags).get.head                         === ("Ben", (7, 3))
    m(Person.name.age ~ Tag.score).get.head                           === (("Ben", 42), 7)
    m(Person.name.age ~ Tag.score.flags).get.head                     === (("Ben", 42), (7, 3))
    
    m(Person.name.age ~
      Tag.score.flags ~
      Cat.name_("pitcher")).get.head === (("Ben", 42), (7, 3))
    T1

    Type of output group 1

    T2

    Type of output group 2

    dsl

    User-defined DSL structure modelling the composite molecule

    returns

    Composite molecule

  33. implicit macro def m[T1](dsl: Composite01[T1]): Molecule01[T1]

    Macro creation of composite molecule from user-defined DSL structure with 1 output group.

    Macro creation of composite molecule from user-defined DSL structure with 1 output group.

    The builder pattern is used to add one or more attributes to an initial namespace like Person from the example below. Further non-related attributes can be tied together with the ~ method to form "composite molecules" that is basically just attributes sharing the same entity id.

    Once the composite molecule models the desired data structure we can call various actions on it, like get that retrieves matching data from the database.

    // Explicitly calling `m` to create composite molecule
    // with 1 output attribute (`name`) and 1 tacit attribute (`score`).
    m(Person.name ~ Tag.score_).get.head === "Ben"
    
    // Alternatively we can create the composite molecule implicitly
    Person.name.~(Tag.score_).get.head === "Ben"

    Composite molecules of arity 1 has only one sub-molecule with output attribute(s). If the sub-molecule has multiple output attributes, a tuple is returned, otherwise just the single value:

    Composite molecule           Composite type (1 output group)
    
    A.a1       ~ B.b1_     =>    a1
    A.a1.a2    ~ B.b1_     =>    (a1, a2)
    A.a1.a2.a3 ~ B.b1_     =>    (a1, a2, a3) etc...
    
    A.a1_ ~ B.b1           =>    b1
    A.a1_ ~ B.b1.b2        =>    (b1, b2)
    A.a1_ ~ B.b1.b2.b3)    =>    (b1, b2, b3) etc...
    
    We could even have multiple tacit sub-molecules with multiple tacit attributes
    A.a1_.a2_ ~ B.b1_ ~ C.c1.c2_.c3     =>    (c1, c3) etc...

    So, given two output attributes, a tuple is returned:

    m(Person.name.age ~ Tag.score_).get.head === ("Ben", 42)
    //  A   . a1 . a2 ~  B .  b1              => (  a1 , a2)
    T1

    Type of output group 1

    dsl

    User-defined DSL structure modelling the composite molecule

    returns

    Composite molecule

  34. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  35. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  36. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  37. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  38. def toString(): String
    Definition Classes
    AnyRef → Any
  39. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  40. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

composite

Ungrouped