trait Molecule_In_3_Factory2 extends AnyRef
Factory methods to create input molecules of arity 1-22 awaiting 3 inputs.
Molecules
Molecules are type-safe custom Scala models of data structures in a Datomic database.
Molecules are build with your custom meta-DSL that is auto-generated from your Schema Definition file.
Calling m
on your modelled DSL structure lets Molecule macros create a custom molecule,
ready for retrieving or manipulating data in the Datomic database.
Each molecule consists of one or more attributes that can have values or expressions applied.
The arity of a molecule is determined by the number of attributes that will return data when the
molecule is queried against the Datomic database. Attributes returning data are called "output attributes".
Input molecules
Input molecules awaiting 3 inputs have one attribute with ?
applied to mark that
it awaits inputs at runtime for those attributes. Once the input molecule has been resolved
with inputs, a normal molecule is returned that we can query against the Datomic database.
For brevity, only arity 1 and 2 method signatures are shown. Arity 3-22 follow the same pattern.
- Source
- Molecule_In_3_Factory.scala
- See also
- Grouped
- Alphabetic
- By Inheritance
- Molecule_In_3_Factory2
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
macro
def
m[I1, I2, I3, A, B](dsl: IN3_02[I1, I2, I3, A, B]): InputMolecule_3_02[I1, I2, I3, A, B]
Macro creation of input molecule awaiting 3 inputs from user-defined DSL structure with 2 output attributes (arity 2).
Macro creation of input molecule awaiting 3 inputs from user-defined DSL structure with 2 output attributes (arity 2).
Molecules are build by adding one or more attributes to an initial namespace likePerson
from the example below.
Applying the?
marker to attributes changes the semantics of a molecule to become an "input molecule" that awaits input at runtime for the attributes marked with?
.
Once the input molecule has been resolved with input, we can call various actions on it, likeget
that retrieves matching data from the database.// Apply `?` to `age`, `score` and `flags` attributes to create input molecule. // Input attributes can be tacit or mandatory val personAgeScoreFlag = m(Person.name.age_(?).score(?).flags_(?)) // At runtime `age`, `score` and `flags` values are applied to get the Person's name and score. // Since `score` was mandatory (without underscore), its value is also returned. personAgeScoreFlag(42, 7, 3).get.head === ("Ben", 7)
- I1
Type of input attribute 1 (
age
: Int)- I2
Type of input attribute 2 (
score
: Int)- I3
Type of input attribute 3 (
flags
: Int)- A
Type of output attribute 1 (
name
: String)- B
Type of output attribute 2 (
score
: Int)- dsl
User-defined DSL structure modelling the input molecule
- returns
Input molecule ready to be resolved
-
macro
def
m[I1, I2, I3, A](dsl: IN3_01[I1, I2, I3, A]): InputMolecule_3_01[I1, I2, I3, A]
Macro creation of input molecule awaiting 3 inputs from user-defined DSL structure with 1 output attribute (arity 1).
Macro creation of input molecule awaiting 3 inputs from user-defined DSL structure with 1 output attribute (arity 1).
Molecules are build by adding one or more attributes to an initial namespace likePerson
from the example below.
Applying the?
marker to attributes changes the semantics of a molecule to become an "input molecule" that awaits input at runtime for the attributes marked with?
.
Once the input molecule has been resolved with input, we can call various actions on it, likeget
that retrieves matching data from the database.// Apply `?` to `age`, `score` and `flags` attributes to create input molecule. val personAgeScoreFlag = m(Person.name.age_(?).score_(?).flags_(?)) // At runtime `age`, `score` and `flags` values are applied to get the Person's name. personAgeScoreFlag(42, 7, 3).get.head === "Ben"
For arity-many molecules, data structures are returned as tuples. But for arity-1 molecules (like the example having only 1 output attribute,
name
) there's no need for a tuple, so values type-safely matching the attribute are returned directly in the list.- I1
Type of input attribute 1 (
age
: Int)- I2
Type of input attribute 2 (
score
: Int)- I3
Type of input attribute 3 (
flags
: Int)- A
Type of output attribute 1 (
name
: String)- dsl
User-defined DSL structure modelling the input molecule
- returns
Input molecule ready to be resolved
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
Documentation/API for the Molecule library - a meta DSL for the Datomic database.
Manual | scalamolecule.org | Github | Forum