Packages

package nested_0

Type Members

  1. trait Nested_0 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.map(_ ==> 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.map(_ ==> 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.

Ungrouped