package composition
- Alphabetic
- By Inheritance
- composition
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- trait Composite extends NS
Add sub-molecule to composite molecule.
Add sub-molecule to composite molecule.
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.
+
methods of this interface adds a new sub-molecule to the composite.// | add sub-molecule m(Article.name.author + Tag.category.weight + Publisher.name).get === List( (("Battle of Waterloo", "Ben Bridge"), ("History", 5), "Bestseller Publications Inc.") )
- See also
Manual | Tests: composite, composite json
- trait CompositeInit extends NS
Build composite molecule.
Build composite molecule.
Composite molecules model entities with attributes from different namespaces that are not necessarily related. Each group of attributes is modelled by a molecule and the "sub-molecules" are tied together with+
methods to form a composite molecule.
The attributes of the first sub-molecule are tied together in a tuple of its own before being merged with the tuple of attribute values of the second sub-molecule. If any of the sub-molecules are of arity-1, then no tuple is created:// Arity 1 + 1 m(Article.name + Tag.category).get === List( ("Battle of Waterloo", "History") ) // Arity 1 + 2 m(Article.name + Tag.category.weight).get === List( ("Battle of Waterloo", ("History", 5)) ) // Arity 2 + 1 m(Article.name.author + Tag.category).get === List( (("Battle of Waterloo", "Ben Bridge"), "History") ) // Arity 2 + 2 m(Article.name.author + Tag.category.weight).get === List( (("Battle of Waterloo", "Ben Bridge"), ("History", 5)) ) // Arity 3 + 2 etc... m(Article.name.author.editor + Tag.category.weight).get === List( (("Battle of Waterloo", "Ben Bridge", "Joe Moe"), ("History", 5)) )
- trait CompositeInit_In_1 extends NS
Build composite molecule from input molecule awaiting 1 input.
Build composite molecule from input molecule awaiting 1 input.
Composite molecules model entities with attributes from different namespaces that are not necessarily related. Each group of attributes is modelled by a molecule and the "sub-molecules" are tied together with+
methods to form a composite molecule.
The attributes of the first input sub-molecule awaiting 1 input are tied together in a tuple of its own before being merged with the tuple of attribute values of the second sub-molecule. If any of the sub-molecules are of arity-1, then no tuple is created:m(Article.name(?).author.editor + Tag.category.weight) .apply("Battle of Waterloo").get === List( (("Battle of Waterloo", "Ben Bridge", "Joe Moe"), ("History", 5)) )
- trait CompositeInit_In_2 extends NS
Build composite molecule from input molecule awaiting 2 inputs.
Build composite molecule from input molecule awaiting 2 inputs.
Composite molecules model entities with attributes from different namespaces that are not necessarily related. Each group of attributes is modelled by a molecule and the "sub-molecules" are tied together with+
methods to form a composite molecule.
The attributes of the first input sub-molecule awaiting 2 inputs are tied together in a tuple of its own before being merged with the tuple of attribute values of the second sub-molecule. If any of the sub-molecules are of arity-1, then no tuple is created:m(Article.name(?).author(?).editor + Tag.category.weight) .apply("Battle of Waterloo", "Ben Bridge").get === List( (("Battle of Waterloo", "Ben Bridge", "Joe Moe"), ("History", 5)) )
- trait CompositeInit_In_3 extends NS
Build composite molecule from input molecule awaiting 3 inputs.
Build composite molecule from input molecule awaiting 3 inputs.
Composite molecules model entities with attributes from different namespaces that are not necessarily related. Each group of attributes is modelled by a molecule and the "sub-molecules" are tied together with+
methods to form a composite molecule.
The attributes of the first input sub-molecule awaiting 3 inputs are tied together in a tuple of its own before being merged with the tuple of attribute values of the second sub-molecule. If any of the sub-molecules are of arity-1, then no tuple is created:m(Article.name(?).author(?).editor(?) + Tag.category.weight) .apply("Battle of Waterloo", "Ben Bridge", "Joe Moe").get === List( (("Battle of Waterloo", "Ben Bridge", "Joe Moe"), ("History", 5)) )
- trait Composite_In_1 extends NS
Add sub-molecule to composite input molecule awaiting 1 input.
Add sub-molecule to composite input molecule awaiting 1 input.
Composite molecules model entities with attributes from different namespaces that are not necessarily related. Each group of attributes is modelled by a molecule and the "sub-molecules" are tied together with+
methods to form a composite molecule.
+
methods of this interface adds a new sub-molecule to the composite.// | input composite | add sub-molecule m(Article.name(?).author + Tag.category.weight + Publisher.name) .apply("Battle of Waterloo").get === List( (("Battle of Waterloo", "Ben Bridge"), ("History", 5), "Bestseller Publications Inc.") )
- trait Composite_In_2 extends NS
Add sub-molecule to composite input molecule awaiting 2 inputs.
Add sub-molecule to composite input molecule awaiting 2 inputs.
Composite molecules model entities with attributes from different namespaces that are not necessarily related. Each group of attributes is modelled by a molecule and the "sub-molecules" are tied together with+
methods to form a composite molecule.
+
methods of this interface adds a new sub-molecule to the composite.// | input composite | add sub-molecule m(Article.name(?).author(?) + Tag.category.weight + Publisher.name) .apply("Battle of Waterloo", "Ben Bridge").get === List( (("Battle of Waterloo", "Ben Bridge"), ("History", 5), "Bestseller Publications Inc.") )
- trait Composite_In_3 extends NS
Add sub-molecule to composite input molecule awaiting 3 inputs.
Add sub-molecule to composite input molecule awaiting 3 inputs.
Composite molecules model entities with attributes from different namespaces that are not necessarily related. Each group of attributes is modelled by a molecule and the "sub-molecules" are tied together with+
methods to form a composite molecule.
+
methods of this interface adds a new sub-molecule to the composite.// | input composite | add sub-molecule m(Article.name(?).author(?) + Tag.category.weight(?) + Publisher.name) .apply("Battle of Waterloo", "Ben Bridge", 5).get === List( (("Battle of Waterloo", "Ben Bridge"), ("History", 5), "Bestseller Publications Inc.") )
- trait Nested extends AnyRef
Add nested molecule.
Add nested molecule.
Related data of cardinality-many referenced entities can be queried in a "flat" way:m(Order.no.LineItem.product.price.quantity).get === List( (23, "Chocolate", 48.00, 1), (23, "Whisky", 38.00, 2) )
For convenience, Molecule offers to automatically nest the same data so that redundancy is avoided and we can work straight on the hierarchical data:
m(Order.no * LineItem.product.price.quantity).get === List( (23, List(("Chocolate", 48.00, 1), ("Whisky", 38.00, 2))) )
Nested molecules can nest up to 7 levels deep.
Internally, Molecule adds entity ids to each level in the query to be able to group data on each level by a unique entity id.- See also
Manual | Tests: nested, nested json, nested json types
- trait Nested_In_1 extends AnyRef
Add nested molecule to input molecule awaiting 1 input.
- trait Nested_In_2 extends AnyRef
Add nested molecule to input molecule awaiting 2 inputs.
- trait Nested_In_3 extends AnyRef
Add nested molecule to input molecule awaiting 3 inputs.
- trait Tx extends AnyRef
Transaction meta data on molecule.
Transaction meta data on molecule.
Tx
takes a transaction meta data molecule with attributes having the transaction id as their entity id.// Save molecule with transaction data Person.name("Ben").Tx(MyMetaData.action("add member")).save.eid // Query for data with transaction meta data - "which persons became members" Person.name.Tx(MyMetaData.action_("add member")).get === List("Ben")
Value Members
- object Composite
+
methods on composite molecule to add sub-molecule. - object CompositeInit
Initial
+
methods on first sub-molecule to merge with second sub-molecule into composite molecule. - object CompositeInit_In_1
Initial
+
methods on first sub-molecule awaiting 1 input to merge with second sub-molecule into composite molecule. - object CompositeInit_In_2
Initial
+
methods on first sub-molecule awaiting 2 inputs to merge with second sub-molecule into composite molecule. - object CompositeInit_In_3
Initial
+
methods on first sub-molecule awaiting 3 inputs to merge with second sub-molecule into composite molecule. - object Composite_In_1
+
methods on composite molecule awaiting 1 input to add sub-molecule. - object Composite_In_2
+
methods on composite molecule awaiting 2 inputs to add sub-molecule. - object Composite_In_3
+
methods on composite molecule awaiting 3 inputs to add sub-molecule. - object Nested
*
methods to add nested molecule. - object Nested_In_1
*
methods to add nested molecule to molecule awaiting 1 input. - object Nested_In_2
*
methods to add nested molecule to molecule awaiting 2 inputs. - object Nested_In_3
*
methods to add nested molecule to molecule awaiting 3 inputs. - object Tx
Tx
interface to save and query tx meta data.
Documentation/API for the Molecule library - a meta DSL for the Datomic database.
Manual | scalamolecule.org | Github | Forum