trait GetObjList[Obj, Tpl] extends GetObjArray[Obj, Tpl] with JavaUtil with Quoted
Data getter methods on molecules that return List[Obj].
For expected smaller result sets it's convenient to return Lists of objects of data.
- Self Type
- Molecule_0[Obj, Tpl]
- Source
- GetObjList.scala
- Grouped
- Alphabetic
- By Inheritance
- GetObjList
- Quoted
- GetObjArray
- JavaUtil
- 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
getObj(implicit conn: Conn): Obj
Convenience method to get head of list of objects matching molecule.
Convenience method to get head of list of objects matching molecule.
val person = Person.name.age.getObj person.name === "Ben" person.age === 42
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object with properties matching the attributes of the molecule
-
def
getObjArray(n: Int)(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof n rows as objects matching molecule.Get
Arrayof n rows as objects matching molecule.Person.name.age.getObjArray(1).map(p => s"${p.name} is ${p.age} years old")) === List( "Ben is 42 years old" )
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.
The Array is only populated with n rows of type-casted objects. Setting n to -1 fetches all rows (same as callinggetObjArraywithout any number of rows parameter).- n
Number of rows. If -1, all rows are fetched.
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of types matching the attributes of the molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncArray method.
-
def
getObjArray(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof all rows as objects matching molecule.Get
Arrayof all rows as objects matching molecule.val persons = Person.name.age.getObjArray // Fast while loop var i = 0 val length = persons.length while(i < length) { val p = persons(i) println(s"${p.name} is ${p.age} years old") // Do stuff with row object... i += 1 }
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of types matching the attributes of the molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncObjArray method.
-
def
getObjArrayAsOf(date: Date, n: Int)(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof n rows as objects matching molecule as of date.Get
Arrayof n rows as objects matching molecule as of date.
Get data at a human point in time (a java.util.Date).val beforeInsert = new java.util.Date // Insert val tx1 = Person.name.age insert List( ("Ben", 42), ("Liz", 37) ) val List(ben, liz) = tx1.eids val afterInsert = new java.util.Date // Update val tx2 = Person(ben).age(43).update val afterUpdate = new java.util.Date // Get Array of all rows as of afterUpdate val persons = Person.name.age.getObjArrayAsOf(afterUpdate) persons(0).name === "Ben" persons(0).age === 43 // <-- updated persons(1).name === "Liz" persons(1).age === 37 // Get Array of n rows as of afterUpdate val persons = Person.name.age.getObjArrayAsOf(afterUpdate, 1) persons(0).name === "Ben" persons(0).age === 43 // <-- updated
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.
The Array is only populated with n rows of type-casted objects.- date
java.util.Date
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of data matching molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncArrayAsOf method.
-
def
getObjArrayAsOf(date: Date)(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof all rows as objects matching molecule as of date.Get
Arrayof all rows as objects matching molecule as of date.
Get data at a human point in time (a java.util.Date).val beforeInsert = new java.util.Date // Insert val tx1 = Person.name.age insert List( ("Ben", 42), ("Liz", 37) ) val List(ben, liz) = tx1.eids val afterInsert = new java.util.Date // Update val tx2 = Person(ben).age(43).update val afterUpdate = new java.util.Date // Retract val tx3 = ben.retract val afterRetract = new java.util.Date // No data yet before insert Person.name.age.getObjArrayAsOf(beforeInsert) === Array() // Get Array of all rows as of afterInsert val persons = Person.name.age.getObjArrayAsOf(afterInsert) persons(0).name === "Ben" persons(0).age === 42 persons(1).name === "Liz" persons(1).age === 37 // Get Array of all rows as of afterUpdate val persons = Person.name.age.getObjArrayAsOf(afterUpdate) persons(0).name === "Ben" persons(0).age === 43 // <-- updated persons(1).name === "Liz" persons(1).age === 37 // Get Array of all rows as of afterRetract val persons = Person.name.age.getObjArrayAsOf(afterRetract) persons(0).name === "Liz" persons(0).age === 37
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.
- date
java.util.Date
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of data matching molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncArrayAsOf method.
-
def
getObjArrayAsOf(tx: TxReport, n: Int)(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof n rows as objects matching molecule as of tx.Get
Arrayof n rows as objects matching molecule as of tx.
Datomic's internalasOfmethod can take a transaction entity id as argument to retrieve a database value as of that transaction (including).
Instead of supplying the transaction entity id, in Molecule we supply a TxReport that contains the transaction entity id (which is used as argument to Datomic internally). This is more convenient when using Molecule since we get a TxReport from transaction operations likeget,update,retractetc.// Insert (tx report 1) val tx1 = Person.name.age insert List( ("Ben", 42), ("Liz", 37) ) val List(ben, liz) = tx1.eids // Update (tx report 2) val tx2 = Person(ben).age(43).update // Get Array of all rows as of tx2 (after update) val persons = Person.name.age.getObjArrayAsOf(tx2) persons(0).name === "Ben" persons(0).age === 43 // <-- updated persons(1).name === "Liz" persons(1).age === 37 // Get Array of n rows as of tx2 (after update) val persons = Person.name.age.getObjArrayAsOf(tx2, 1) persons(0).name === "Ben" persons(0).age === 43 // <-- updated
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.
The Array is only populated with n rows of type-casted objects.- tx
TxReport (returned from all molecule transaction operations)
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of data matching molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncArrayAsOf method.
-
def
getObjArrayAsOf(tx: TxReport)(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof all rows as objects matching molecule as of tx.Get
Arrayof all rows as objects matching molecule as of tx.
Datomic's internalasOfmethod can take a transaction entity id as argument to retrieve a database value as of that transaction (including).
Instead of supplying the transaction entity id, in Molecule we supply a TxReport that contains the transaction entity id (which is used as argument to Datomic internally). This is more convenient when using Molecule since we get a TxReport from transaction operations likeget,update,retractetc.// Insert (tx report 1) val tx1 = Person.name.age insert List( ("Ben", 42), ("Liz", 37) ) val List(ben, liz) = tx1.eids // Update (tx report 2) val tx2 = Person(ben).age(43).update // Retract (tx report 3) val tx3 = ben.retract // Get Array of all rows as of tx1 (after insert) val persons = Person.name.age.getObjArrayAsOf(tx1) persons(0).name === "Ben" persons(0).age === 42 persons(1).name === "Liz" persons(1).age === 37 // Get Array of all rows as of tx2 (after update) val persons = Person.name.age.getObjArrayAsOf(tx2) persons(0).name === "Ben" persons(0).age === 43 // <-- updated persons(1).name === "Liz" persons(1).age === 37 // Get Array of all rows as of tx3 (after retract) val persons = Person.name.age.getObjArrayAsOf(tx3) persons(0).name === "Liz" persons(0).age === 37
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.
- tx
TxReport (returned from all molecule transaction operations)
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of data matching molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncArrayAsOf method.
-
def
getObjArrayAsOf(t: Long, n: Int)(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof n rows as objects matching molecule as of transaction timet.Get
Arrayof n rows as objects matching molecule as of transaction timet.
Transaction timetis an auto-incremented transaction number assigned internally by Datomic.
tcan for instance be retrieved in a getHistory call for an attribute and then be used to get data as of that point in time (including that transaction):// Insert (t 1028) val List(ben, liz) = Person.name.age insert List( ("Ben", 42), ("Liz", 37) ) eids // Update (t 1031) Person(ben).age(43).update // History of Ben Person(ben).age.t.op.getHistory.sortBy(r => (r._2, r._3)) === List( (42, 1028, true), // Insert: 42 asserted (42, 1031, false), // Update: 42 retracted (43, 1031, true), // 43 asserted ) // Get Array of all rows as of transaction t 1031 (after update) val persons = Person.name.age.getObjArrayAsOf(1031) persons(0).name === "Ben" persons(0).age === 43 // <-- updated persons(1).name === "Liz" persons(1).age === 37 // Get Array of n rows as of transaction t 1031 (after update) val persons = Person.name.age.getObjArrayAsOf(1031) persons(0).name === "Ben" persons(0).age === 43 // <-- updated
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.
The Array is only populated with n rows of type-casted objects.- t
Long Transaction time t
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of data matching molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncArrayAsOf method.
-
def
getObjArrayAsOf(t: Long)(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof all rows as objects matching molecule as of transaction timet.Get
Arrayof all rows as objects matching molecule as of transaction timet.
Transaction timetis an auto-incremented transaction number assigned internally by Datomic.
tcan for instance be retrieved in a getHistory call for an attribute and then be used to get data as of that point in time (including that transaction):// Insert (t 1028) val List(ben, liz) = Person.name.age insert List( ("Ben", 42), ("Liz", 37) ) eids // Update (t 1031) Person(ben).age(43).update // Retract (t 1032) ben.retract // History of Ben Person(ben).age.t.op.getHistory.sortBy(r => (r._2, r._3)) === List( (42, 1028, true), // Insert: 42 asserted (42, 1031, false), // Update: 42 retracted (43, 1031, true), // 43 asserted (43, 1032, false) // Retract: 43 retracted ) // Get Array of data as of transaction t 1028 (after insert) val persons = Person.name.age.getObjArrayAsOf(1028) persons(0).name === "Ben" persons(0).age === 42 persons(1).name === "Liz" persons(1).age === 37 // Get Array of data as of transaction t 1031 (after update) val persons = Person.name.age.getObjArrayAsOf(1031) persons(0).name === "Ben" persons(0).age === 43 // <-- updated persons(1).name === "Liz" persons(1).age === 37 // Get Array of all rows as of transaction t 1032 (after retract) val persons = Person.name.age.getObjArrayAsOf(1032) persons(0).name === "Liz" persons(0).age === 37
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the typed data set.
- t
Transaction time t
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of data matching molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncArrayAsOf method.
-
def
getObjArraySince(date: Date, n: Int)(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof n rows as objects matching molecule since date.Get
Arrayof n rows as objects matching molecule since date.
Get data added/retracted since a human point in time (a java.util.Date).// Transact 3 times (`inst` retrieves transaction time/Date from tx report) val date1 = Person.name("Ann").save.inst val date2 = Person.name("Ben").save.inst val date3 = Person.name("Cay").save.inst // Current values val persons = Person.name.getObjArray persons(0).name === "Ann" persons(1).name === "Ben" persons(2).name === "Cay" // Ben and Cay added since date1 val persons = Person.name.getObjArraySince(date1) persons(0).name === "Ben" persons(1).name === "Cay" // Ben and Cay added since date1 - only n (1) rows returned val persons = Person.name.getObjArraySince(date1, 1) persons(0).name === "Ben"
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.
The Array is only populated with n rows of type-casted objects.- date
java.util.Date
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of data matching molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncArraySince method.
-
def
getObjArraySince(date: Date)(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof all rows as objects matching molecule since date.Get
Arrayof all rows as objects matching molecule since date.
Get data added/retracted since a human point in time (a java.util.Date).// Transact 3 times (`inst` retrieves transaction time/Date from tx report) val date1 = Person.name("Ann").save.inst val date2 = Person.name("Ben").save.inst val date3 = Person.name("Cay").save.inst // Current values val persons = Person.name.getObjArray persons(0).name === "Ann" persons(1).name === "Ben" persons(2).name === "Cay" // Ben and Cay added since date1 val persons = Person.name.getObjArraySince(date1) persons(0).name === "Ben" persons(1).name === "Cay" // Cay added since transaction time date2 val persons = Person.name.getObjArraySince(date2) persons(0).name === "Cay" // Nothing added since transaction time date3 Person.name.getObjArraySince(date3) === Array()
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.
- date
java.util.Date
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of data matching molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncArraySince method.
-
def
getObjArraySince(tx: TxReport, n: Int)(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof n rows as objects matching molecule since tx.Get
Arrayof n rows as objects matching molecule since tx.
Datomic's internalsincecan take a transaction entity id as argument to retrieve a database value since that transaction (excluding the transaction itself).
Instead of supplying the transaction entity id, in Molecule we supply a TxReport that contains the transaction entity id (which is used as argument to Datomic internally). This is more convenient when using Molecule since we getAsync a TxReport from transaction operations likeget,update,retractetc.// Get tx reports for 3 transactions val tx1 = Person.name("Ann").save val tx2 = Person.name("Ben").save val tx3 = Person.name("Cay").save // Current values val persons = Person.name.getObjArray persons(0).name === "Ann" persons(1).name === "Ben" persons(2).name === "Cay" // Ben and Cay added since tx1 val persons = Person.name.getObjArraySince(tx1) persons(0).name === "Ben" persons(1).name === "Cay" // Ben and Cay added since tx1 - only n (1) rows returned val persons = Person.name.getObjArraySince(tx1, 1) persons(0).name === "Ben"
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.
The Array is only populated with n rows of type-casted objects.- tx
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of data matching molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncArraySince method.
-
def
getObjArraySince(tx: TxReport)(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof all rows as objects matching molecule since tx.Get
Arrayof all rows as objects matching molecule since tx.
Datomic's internalsincecan take a transaction entity id as argument to retrieve a database value since that transaction (excluding the transaction itself).
Instead of supplying the transaction entity id, in Molecule we supply a TxReport that contains the transaction entity id (which is used as argument to Datomic internally). This is more convenient when using Molecule since we getAsync a TxReport from transaction operations likeget,update,retractetc.// Get tx reports for 3 transactions val tx1 = Person.name("Ann").save val tx2 = Person.name("Ben").save val tx3 = Person.name("Cay").save // Current values val persons = Person.name.getObjArray persons(0).name === "Ann" persons(1).name === "Ben" persons(2).name === "Cay" // Ben and Cay added since transaction time tx1 val persons = Person.name.getObjArraySince(tx1) persons(0).name === "Ben" persons(1).name === "Cay" // Cay added since transaction time tx2 val persons = Person.name.getObjArraySince(tx2) persons(0).name === "Cay" // Nothing added since transaction time tx3 Person.name.getObjArraySince(tx3) === Array()
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.
- tx
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of data matching molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncArraySince method.
-
def
getObjArraySince(t: Long, n: Int)(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof n rows as objects matching molecule since transaction timet.Get
Arrayof n rows as objects matching molecule since transaction timet.
Transaction timetis an auto-incremented transaction number assigned internally by Datomic.
tcan for instance be retrieved by callington the tx report returned from transactional operations and then be used to get data since that point in time (excluding that transaction):// 3 transaction times `t` val t1 = Person.name("Ann").save.t val t2 = Person.name("Ben").save.t val t3 = Person.name("Cay").save.t // Current values val persons = Person.name.getObjArray persons(0).name === "Ann" persons(1).name === "Ben" persons(2).name === "Cay" // Ben and Cay added since transaction time t1 val persons = Person.name.getObjArraySince(t1) persons(0).name === "Ben" persons(1).name === "Cay" // Ben and Cay added since transaction time t1 - only n (1) rows returned val persons = Person.name.getObjArraySince(t1, 1) persons(0).name === "Ben"
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.
The Array is only populated with n rows of type-casted objects.- t
Transaction time t
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of data matching molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncArraySince method.
-
def
getObjArraySince(t: Long)(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof all rows as objects matching molecule since transaction timet.Get
Arrayof all rows as objects matching molecule since transaction timet.
Transaction timetis an auto-incremented transaction number assigned internally by Datomic.
tcan for instance be retrieved by callington the tx report returned from transactional operations and then be used to get data since that point in time (excluding that transaction):// 3 transaction times `t` val t1 = Person.name("Ann").save.t val t2 = Person.name("Ben").save.t val t3 = Person.name("Cay").save.t // Current values val persons = Person.name.getObjArray persons(0).name === "Ann" persons(1).name === "Ben" persons(2).name === "Cay" // Ben and Cay added since transaction time t1 val persons = Person.name.getObjArraySince(t1) persons(0).name === "Ben" persons(1).name === "Cay" // Cay added since transaction time t2 val persons = Person.name.getObjArraySince(t2) persons(0).name === "Cay" // Nothing added since transaction time t3 Person.name.getObjArraySince(t3) === Array()
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.
- t
Transaction time t
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of data matching molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncArraySince method.
-
def
getObjArrayWith(txData: List[_], n: Int)(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof n rows as objects matching molecule with applied raw transaction data.Get
Arrayof n rows as objects matching molecule with applied raw transaction data.
Apply raw transaction data to in-memory "branch" of db without affecting db to see how it would then look:// Live size of Person db Person.name.get.size === 150 // Read some transaction data from file val data_rdr2 = new FileReader("examples/resources/seattle/seattle-data1a.dtm") val newDataTx = Util.readAll(data_rdr2).get(0).asInstanceOf[java.util.List[Object]] // Imagine future db - 100 persons would be added, apparently Person.name.getObjArrayWith(newDataTx).size === 250 // Imagine future db - Let's just take 10 Person.name.getObjArrayWith(newDataTx, 10).size === 10
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.
The Array is only populated with n rows of type-casted objects.- txData
Raw transaction data as java.util.List[Object]
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of data matching molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncArrayWith method.
-
def
getObjArrayWith(txData: List[_])(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof all rows as objects matching molecule with applied raw transaction data.Get
Arrayof all rows as objects matching molecule with applied raw transaction data.
Apply raw transaction data to in-memory "branch" of db without affecting db to see how it would then look:// Live size of Person db Person.name.get.size === 150 // Read some transaction data from file val data_rdr2 = new FileReader("examples/resources/seattle/seattle-data1a.dtm") val newDataTx = Util.readAll(data_rdr2).get(0).asInstanceOf[java.util.List[Object]] // Imagine future db - 100 persons would be added, apparently Person.name.getObjArrayWith(newDataTx).size === 250
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.
- txData
Raw transaction data as java.util.List[Object]
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of data matching molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncArrayWith method.
-
def
getObjArrayWith(n: Int, txMolecules: Seq[Seq[Statement]]*)(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof n rows as objects matching molecule with applied molecule transaction data.Get
Arrayof n rows as objects matching molecule with applied molecule transaction data.
Apply one or more molecule transactions to in-memory "branch" of db without affecting db to see how it would then look:// Current state val List(ben, liz) = Person.name.likes.insert( ("Ben", "pasta"), ("Liz", "pizza") ).eids // Current state val persons = Person.name.likes.getObjArray persons(0).name === "Ben" persons(0).likes === "pasta" persons(1).name === "Liz" persons(1).likes === "pizza" // Test adding transaction data val personsTest = Person.name.likes.getObjArrayWith( Person(ben).likes("sushi").getUpdateTx, Person(liz).likes("cake").getUpdateTx ) // Effect: sushi and cake now liked personsTest(0).name === "Ben" personsTest(0).likes === "sushi" personsTest(1).name === "Liz" personsTest(1).likes === "cake" // Same as above, but only n (1) rows returned: val personsTest1 = Person.name.likes.getObjArrayWith( 1 Person(ben).likes("sushi").getUpdateTx, Person(liz).likes("cake").getUpdateTx ) // Effect: sushi and cake now liked (but only Ben returned) personsTest1(0).name === "Ben" personsTest1(0).likes === "sushi" // Current state is still the same val personsAfter = Person.name.likes.getObjArray personsAfter(0).name === "Ben" personsAfter(0).likes === "pasta" personsAfter(1).name === "Liz" personsAfter(1).likes === "pizza"
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.
The Array is only populated with n rows of type-casted objects.- n
Int Number of rows returned
- txMolecules
Transaction statements from applied Molecules with test data
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of data matching molecule
- Definition Classes
- GetObjArray
- Note
Note how the
nparameter has to come before thetxMoleculesvararg.- See also
Equivalent asynchronous getAsyncArrayWith method.
-
def
getObjArrayWith(txMolecules: Seq[Seq[Statement]]*)(implicit conn: Conn, objType: ClassTag[Obj], tplType: ClassTag[Tpl]): Array[Obj]
Get
Arrayof all rows as objects matching molecule with applied molecule transaction data.Get
Arrayof all rows as objects matching molecule with applied molecule transaction data.
Apply one or more molecule transactions to in-memory "branch" of db without affecting db to see how it would then look:// Current state val ben = Person.name("Ben").likes("pasta").save.eid val persons = Person.name.likes.getObjArray persons(0).name === "Ben" persons(0).likes === "pasta" // Test adding transaction data val personsTest = Person.name.likes.getObjArrayWith( // Additional transaction data Person(ben).likes("sushi").getUpdateTx ) // Effect: Ben would like sushi if tx was applied personTest(0).name === "Ben" personTest(0).likes === "sushi" // Current state is still the same val personsAfter = Person.name.likes.getObjArray personsAfter(0).name === "Ben" personsAfter(0).likes === "pasta"
Multiple transactions can be applied to test more complex what-if scenarios!
Getting a pre-allocated Array populated with typed data is the fastest way to query Datomic with Molecule. Looping the Array in a while loop with a mutable index pointer will also be the fastest way to traverse the data set.- txMolecules
Transaction statements from applied Molecules with test data
- conn
Implicit Conn value in scope
- tplType
Implicit
ClassTag[Obj]to capture the object type for Array- returns
Array[Obj] where Obj is an object of data matching molecule
- Definition Classes
- GetObjArray
- See also
Equivalent asynchronous getAsyncArrayWith method.
-
def
getObjList(n: Int)(implicit conn: Conn): List[Obj]
Get
Listof n rows as objects matching molecule.Get
Listof n rows as objects matching molecule.
Only n rows are type-casted.val List(p1) = Person.name.age.getObjList(1) p1.name === "Ben" p1.age === 42
- n
Int Number of rows returned. If n == -1, all rows are returned
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object with properties matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjList method.
-
def
getObjList(implicit conn: Conn): List[Obj]
Get
Listof all rows as objects matching molecule.Get
Listof all rows as objects matching molecule.val List(p1, p2) = Person.name.age.getObjList p1.name === "Ben" p1.age === 42 p2.name === "Liz" p2.age === 37
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object with properties matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjList method.
-
def
getObjListAsOf(date: Date, n: Int)(implicit conn: Conn): List[Obj]
Get
Listof n rows as objects matching molecule as of date.Get
Listof n rows as objects matching molecule as of date.
Get data at a human point in time (a java.util.Date).val beforeInsert = new java.util.Date // Insert val tx1 = Person.name.age insert List( ("Ben", 42), ("Liz", 37) ) val List(ben, liz) = tx1.eids val afterInsert = new java.util.Date // Update val tx2 = Person(ben).age(43).update val afterUpdate = new java.util.Date // Get List of all rows as of afterUpdate val List(a1, a2) = Person.name.age.getObjListAsOf(afterUpdate) a1.name === "Ben" a1.age === 43 // <-- updated a2.name === "Liz" a2.age === 37 // Get List of n rows as of afterUpdate val List(b1) = Person.name.age.getObjListAsOf(afterUpdate, 1) b1.name === "Ben" b1.age === 43 // <-- updated
- date
java.util.Date
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjListAsOf method.
-
def
getObjListAsOf(date: Date)(implicit conn: Conn): List[Obj]
Get
Listof all rows as objects matching molecule as of date.Get
Listof all rows as objects matching molecule as of date.
Get data at a human point in time (a java.util.Date).val beforeInsert = new java.util.Date // Insert val tx1 = Person.name.age insert List( ("Ben", 42), ("Liz", 37), ) val List(ben, liz) = tx1.eids val afterInsert = new java.util.Date // Update val tx2 = Person(ben).age(43).update val afterUpdate = new java.util.Date // Retract val tx3 = ben.retract val afterRetract = new java.util.Date // No data yet before insert Person.name.age.getObjListAsOf(beforeInsert) === List() // Get List of all rows as of afterInsert val List(a1, a2) = Person.name.age.getObjListAsOf(afterInsert) a1.name === "Ben" a1.age === 42 a2.name === "Liz" a2.age === 37 // Get List of all rows as of afterUpdate val List(b1, b2) = Person.name.age.getObjListAsOf(afterUpdate) b1.name === "Ben" b1.age === 43 // <-- updated b2.name === "Liz" b2.age === 37 // Get List of all rows as of afterRetract val List(c1) = Person.name.age.getObjListAsOf(afterRetract) c1.name === "Liz" c1.age === 37
- date
java.util.Date
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjListAsOf method.
-
def
getObjListAsOf(tx: TxReport, n: Int)(implicit conn: Conn): List[Obj]
Get
Listof n rows as objects matching molecule as of tx.Get
Listof n rows as objects matching molecule as of tx.
Datomic's internalasOfmethod can take a transaction entity id as argument to retrieve a database value as of that transaction (including).
Instead of supplying the transaction entity id, in Molecule we supply a TxReport that contains the transaction entity id (which is used as argument to Datomic internally). This is more convenient when using Molecule since we get a TxReport from transaction operations likeget,update,retractetc.// Insert (tx report 1) val tx1 = Person.name.age insert List( ("Ben", 42), ("Liz", 37) ) val List(ben, liz) = tx1.eids // Update (tx report 2) val tx2 = Person(ben).age(43).update // Get List of all rows as of tx2 (after update) val List(a1, a2) = Person.name.age.getObjListAsOf(tx2) a1.name === "Ben" a1.age === 43 // <-- updated a2.name === "Liz" a2.age === 37 // Get List of n rows as of tx2 (after update) val List(b1) = Person.name.age.getObjListAsOf(tx2, 1) b1.name === "Ben" b1.age === 43 // <-- updated
- tx
TxReport (returned from all molecule transaction operations)
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjListAsOf method.
-
def
getObjListAsOf(tx: TxReport)(implicit conn: Conn): List[Obj]
Get
Listof all rows as objects matching molecule as of tx.Get
Listof all rows as objects matching molecule as of tx.
Datomic's internalasOfmethod can take a transaction entity id as argument to retrieve a database value as of that transaction (including).
Instead of supplying the transaction entity id, in Molecule we supply a TxReport that contains the transaction entity id (which is used as argument to Datomic internally). This is more convenient when using Molecule since we get a TxReport from transaction operations likeget,update,retractetc.// Insert (tx report 1) val tx1 = Person.name.age insert List( ("Ben", 42), ("Liz", 37), ) val List(ben, liz) = tx1.eids // Update (tx report 2) val tx2 = Person(ben).age(43).update // Retract (tx report 3) val tx3 = ben.retract // Get List of all rows as of tx1 (after insert) val List(a1, a2) = Person.name.age.getObjListAsOf(tx1) a1.name === "Ben" a1.age === 42 a2.name === "Liz" a2.age === 37 // Get List of all rows as of tx2 (after update) val List(b1, b2) = Person.name.age.getObjListAsOf(tx2) b1.name === "Ben" b1.age === 43 // <-- updated b2.name === "Liz" b2.age === 37 // Get List of all rows as of tx3 (after retract) val List(c1) = Person.name.age.getObjListAsOf(tx3) c1.name === "Liz" c1.age === 37
- tx
TxReport (returned from all molecule transaction operations)
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjListAsOf method.
-
def
getObjListAsOf(t: Long, n: Int)(implicit conn: Conn): List[Obj]
Get
Listof n rows as objects matching molecule as of transaction timet.Get
Listof n rows as objects matching molecule as of transaction timet.
Transaction timetis an auto-incremented transaction number assigned internally by Datomic.
tcan for instance be retrieved in a getHistory call for an attribute and then be used to get data as of that point in time (including that transaction):// Insert (t 1028) val List(ben, liz) = Person.name.age insert List( ("Ben", 42), ("Liz", 37), ) eids // Update (t 1031) Person(ben).age(43).update // History of Ben Person(ben).age.t.op.getHistory.sortBy(r => (r._2, r._3)) === List( (42, 1028, true), // Insert: 42 asserted (42, 1031, false), // Update: 42 retracted (43, 1031, true), // 43 asserted ) // Get List of all rows as of transaction t 1031 (after update) val List(a1, a2) = Person.name.age.getObjListAsOf(1031) a1.name === "Ben" a1.age === 43 // <-- updated a2.name === "Liz" a2.age === 37 // Get List of n rows as of transaction t 1031 (after update) val List(b1) = Person.name.age.getObjListAsOf(1031) b1.name === "Ben" b1.age === 43 // <-- updated
- t
Long Transaction time t
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjListAsOf method.
-
def
getObjListAsOf(t: Long)(implicit conn: Conn): List[Obj]
Get
Listof all rows as objects matching molecule as of transaction timet.Get
Listof all rows as objects matching molecule as of transaction timet.
Transaction timetis an auto-incremented transaction number assigned internally by Datomic.
tcan for instance be retrieved in a getHistory call for an attribute and then be used to get data as of that point in time (including that transaction):// Insert (t 1028) val List(ben, liz) = Person.name.age insert List( ("Ben", 42), ("Liz", 37), ) eids // Update (t 1031) Person(ben).age(43).update // Retract (t 1032) ben.retract // History of Ben Person(ben).age.t.op.getHistory.sortBy(r => (r._2, r._3)) === List( (42, 1028, true), // Insert: 42 asserted (42, 1031, false), // Update: 42 retracted (43, 1031, true), // 43 asserted (43, 1032, false) // Retract: 43 retracted ) // Get List of data as of transaction t 1028 (after insert) val List(a1, a2) = Person.name.age.getObjListAsOf(1028) a1.name === "Ben" a1.age === 42 a2.name === "Liz" a2.age === 37 // Get List of data as of transaction t 1031 (after update) val List(b1, b2) = Person.name.age.getObjListAsOf(1031) b1.name === "Ben" b1.age === 43 // <-- updated b2.name === "Liz" b2.age === 37 // Get List of all rows as of transaction t 1032 (after retract) val List(c1) = Person.name.age.getObjListAsOf(1032) c1.name === "Liz" c1.age === 37
- t
Transaction time t
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjListAsOf method.
-
def
getObjListHistory(implicit conn: Conn): List[Obj]
Get history of operations as
Liston an attribute in the db.Get history of operations as
Liston an attribute in the db.
Generic datom attributes that can be called whengetHistoryis called:
e- Entity id
a- Attribute name
v- Attribute value
ns- Namespace name
tx- TxReport
t- Transaction time t
txInstant- Transaction time as java.util.Date
op- Operation: true (add) or false (retract)
Example:// Insert (t 1028) val List(ben, liz) = Person.name.age insert List( ("Ben", 42), ("Liz", 37), ) eids // Update (t 1031) Person(ben).age(43).update // Retract (t 1032) ben.retract // History of Ben Person(ben).age.t.op.getObjListHistory .sortBy(o => (o.t, o.op)) .map(o => s"${o.age} ${o.t} ${o.op}") === List( "42 1028 true", // Insert: 42 asserted "42 1031 false", // Update: 42 retracted "43 1031 true", // 43 asserted "43 1032 false" // Retract: 43 retracted )
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjListHistory method.
-
def
getObjListSince(date: Date, n: Int)(implicit conn: Conn): List[Obj]
Get
Listof n rows as objects matching molecule since date.Get
Listof n rows as objects matching molecule since date.
Get data added/retracted since a human point in time (a java.util.Date).// Transact 3 times (`inst` retrieves transaction time/Date from tx report) val date1 = Person.name("Ann").save.inst val date2 = Person.name("Ben").save.inst val date3 = Person.name("Cay").save.inst // Current values val List(a1, a2, a3) = Person.name.getObjList a1.name === "Ann" a2.name === "Ben" a3.name === "Cay" // Ben and Cay added since date1 val List(b1, b2) = Person.name.getObjListSince(date1) b1.name === "Ben" b2.name === "Cay" // Ben and Cay added since date1 - only n (1) rows returned val List(c1) = Person.name.getObjListSince(date1, 1) c1.name === "Ben"
- date
java.util.Date
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjListSince method.
-
def
getObjListSince(date: Date)(implicit conn: Conn): List[Obj]
Get
Listof all rows as objects matching molecule since date.Get
Listof all rows as objects matching molecule since date.
Get data added/retracted since a human point in time (a java.util.Date).// Transact 3 times (`inst` retrieves transaction time/Date from tx report) val date1 = Person.name("Ann").save.inst val date2 = Person.name("Ben").save.inst val date3 = Person.name("Cay").save.inst // Current values val List(a1, a2, a3) = Person.name.getObjList a1.name === "Ann" a2.name === "Ben" a3.name === "Cay" // Ben and Cay added since date1 val List(b1, b2) = Person.name.getObjListSince(date1) b1.name === "Ben" b2.name === "Cay" // Cay added since transaction time date2 val List(c1) = Person.name.getObjListSince(date2) c1.name === "Cay" // Nothing added since transaction time date3 Person.name.getObjListSince(date3) === List()
- date
java.util.Date
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjListSince method.
-
def
getObjListSince(tx: TxReport, n: Int)(implicit conn: Conn): List[Obj]
Get
Listof n rows as objects matching molecule since tx.Get
Listof n rows as objects matching molecule since tx.
Datomic's internalsincecan take a transaction entity id as argument to retrieve a database value since that transaction (excluding the transaction itself).
Instead of supplying the transaction entity id, in Molecule we supply a TxReport that contains the transaction entity id (which is used as argument to Datomic internally). This is more convenient when using Molecule since we getAsyncObjList a TxReport from transaction operations likeget,update,retractetc.// Get tx reports for 3 transactions val tx1 = Person.name("Ann").save val tx2 = Person.name("Ben").save val tx3 = Person.name("Cay").save // Current values val List(a1, a2, a3) = Person.name.getObjList a1.name === "Ann" a2.name === "Ben" a3.name === "Cay" // Ben and Cay added since tx1 val List(b1, b2) = Person.name.getObjListSince(tx1) b1.name === "Ben" b2.name === "Cay" // Ben and Cay added since tx1 - only n (1) rows returned val List(c1) = Person.name.getObjListSince(tx1, 1) c1.name === "Ben"
- tx
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjListSince method.
-
def
getObjListSince(tx: TxReport)(implicit conn: Conn): List[Obj]
Get
Listof all rows as objects matching molecule since tx.Get
Listof all rows as objects matching molecule since tx.
Datomic's internalsincecan take a transaction entity id as argument to retrieve a database value since that transaction (excluding the transaction itself).
Instead of supplying the transaction entity id, in Molecule we supply a TxReport that contains the transaction entity id (which is used as argument to Datomic internally). This is more convenient when using Molecule since we getAsyncObjList a TxReport from transaction operations likeget,update,retractetc.// Get tx reports for 3 transactions val tx1 = Person.name("Ann").save val tx2 = Person.name("Ben").save val tx3 = Person.name("Cay").save // Current values val List(a1, a2, a3) = Person.name.getObjList a1.name === "Ann" a2.name === "Ben" a3.name === "Cay" // Ben and Cay added since transaction time tx1 val List(b1, b2) = Person.name.getObjListSince(tx1) b1.name === "Ben" b2.name === "Cay" // Cay added since transaction time tx2 val List(c1) = Person.name.getObjListSince(tx2) c1.name === "Cay" // Nothing added since transaction time tx3 Person.name.getObjListSince(tx3) === List()
- tx
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjListSince method.
-
def
getObjListSince(t: Long, n: Int)(implicit conn: Conn): List[Obj]
Get
Listof n rows as objects matching molecule since transaction timet.Get
Listof n rows as objects matching molecule since transaction timet.
Transaction timetis an auto-incremented transaction number assigned internally by Datomic.
tcan for instance be retrieved by callington the tx report returned from transactional operations and then be used to get data since that point in time (excluding that transaction):// 3 transaction times `t` val t1 = Person.name("Ann").save.t val t2 = Person.name("Ben").save.t val t3 = Person.name("Cay").save.t // Current values val List(a1, a2, a3) = Person.name.getObjList a1.name === "Ann" a2.name === "Ben" a3.name === "Cay" // Ben and Cay added since transaction time t1 val List(b1, b2) = Person.name.getObjListSince(t1) b1.name === "Ben" b2.name === "Cay" // Ben and Cay added since transaction time t1 - only n (1) rows returned val List(c1) = Person.name.getObjListSince(t1, 1) c1.name === "Ben"
- t
Transaction time t
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjListSince method.
-
def
getObjListSince(t: Long)(implicit conn: Conn): List[Obj]
Get
Listof all rows as objects matching molecule since transaction timet.Get
Listof all rows as objects matching molecule since transaction timet.
Transaction timetis an auto-incremented transaction number assigned internally by Datomic.
tcan for instance be retrieved by callington the tx report returned from transactional operations and then be used to get data since that point in time (excluding that transaction):// 3 transaction times `t` val t1 = Person.name("Ann").save.t val t2 = Person.name("Ben").save.t val t3 = Person.name("Cay").save.t // Current values val List(a1, a2, a3) = Person.name.getObjList a1.name === "Ann" a2.name === "Ben" a3.name === "Cay" // Ben and Cay added since transaction time t1 val List(b1, b2) = Person.name.getObjListSince(t1) b1.name === "Ben" b2.name === "Cay" // Cay added since transaction time t2 val List(c1) = Person.name.getObjListSince(t2) c1.name === "Cay" // Nothing added since transaction time t3 Person.name.getObjListSince(t3) === List()
- t
Transaction time t
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjListSince method.
-
def
getObjListWith(txData: List[_], n: Int)(implicit conn: Conn): List[Obj]
Get
Listof n rows as objects matching molecule with applied raw transaction data.Get
Listof n rows as objects matching molecule with applied raw transaction data.
Apply raw transaction data to in-memory "branch" of db without affecting db to see how it would then look:// Live size of Person db Person.name.get.size === 150 // Read some transaction data from file val data_rdr2 = new FileReader("examples/resources/seattle/seattle-data1a.dtm") val newDataTx = Util.readAll(data_rdr2).getObjList(0).asInstanceOf[java.util.List[Object]] // Imagine future db - 100 persons would be added, apparently Person.name.getWith(newDataTx).size === 250 // Imagine future db - Let's just take 10 Person.name.getWith(newDataTx, 10).size === 10
- txData
Raw transaction data as java.util.List[Object]
- n
Int Number of rows returned
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjListWith method.
-
def
getObjListWith(txData: List[_])(implicit conn: Conn): List[Obj]
Get
Listof all rows as objects matching molecule with applied raw transaction data.Get
Listof all rows as objects matching molecule with applied raw transaction data.
Apply raw transaction data to in-memory "branch" of db without affecting db to see how it would then look:// Live size of Person db Person.name.get.size === 150 // Read some transaction data from file val data_rdr2 = new FileReader("examples/resources/seattle/seattle-data1a.dtm") val newDataTx = Util.readAll(data_rdr2).getObjList(0).asInstanceOf[java.util.List[Object]] // Imagine future db - 100 persons would be added, apparently Person.name.getWith(newDataTx).size === 250
- txData
Raw transaction data as java.util.List[Object]
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjListWith method.
-
def
getObjListWith(n: Int, txMolecules: Seq[Seq[Statement]]*)(implicit conn: Conn): List[Obj]
Get
Listof n rows as objects matching molecule with applied molecule transaction data.Get
Listof n rows as objects matching molecule with applied molecule transaction data.
Apply one or more molecule transactions to in-memory "branch" of db without affecting db to see how it would then look:// Current state val List(ben, liz) = Person.name.likes.insert( ("Ben", "pasta"), ("Liz", "pizza") ).eids val List(p1, p2) = Person.name.likes.getObjList p1.name === "Ben" p1.likes === "pasta" p2.name === "Liz" p2.likes === "pizza" // Test multiple transactions val List(testP1, testP2) = Person.name.likes.getObjListWith( Person(ben).likes("sushi").getUpdateTx, Person(liz).likes("cake").getUpdateTx ) // Effect: sushi and cake now liked testP1.name === "Ben" testP1.likes === "sushi" testP2.name === "Liz" testP2.likes === "cake" // Same as above, but only n (1) rows returned: val List(oneTestP) = Person.name.likes.getObjListWith( 1 Person(ben).likes("sushi").getUpdateTx, Person(liz).likes("cake").getUpdateTx ) // Effect: sushi and cake now liked (but only Ben returned) oneTestP.name === "Ben" oneTestP.likes === "sushi" // Current state is still the same val List(p3, p4) = Person.name.likes.getObjList p3.name === "Ben" p3.likes === "pasta" p4.name === "Liz" p4.likes === "pizza"
- n
Int Number of rows returned
- txMolecules
Transaction statements from applied Molecules with test data
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- Note
Note how the
nparameter has to come before thetxMoleculesvararg.- See also
Equivalent asynchronous getAsyncObjListWith method.
-
def
getObjListWith(txMolecules: Seq[Seq[Statement]]*)(implicit conn: Conn): List[Obj]
Get
Listof all rows as objects matching molecule with applied molecule transaction data.Get
Listof all rows as objects matching molecule with applied molecule transaction data.
Apply one or more molecule transactions to in-memory "branch" of db without affecting db to see how it would then look:// Current state val ben = Person.name("Ben").likes("pasta").save.eid val List(p0) = Person.name.likes.getObjList p0.name === "Ben" p0.likes === "pasta" // Test adding transaction data val List(pTest) = Person.name.likes.getObjListWith( // Additional transaction data Person(ben).likes("sushi").getUpdateTx ) // Effect: Ben would like sushi if tx was applied pTest.name === "Ben" pTest.likes === "sushi" // Current state is still the same val List(pAfter) = Person.name.likes.getObjList pAfter.name === "Ben" pAfter.likes === "pasta"
Multiple transactions can be applied to test more complex what-if scenarios!
- txMolecules
Transaction statements from applied Molecules with test data
- conn
Implicit Conn value in scope
- returns
List[Obj] where Obj is an object type having property types matching the attributes of the molecule
- See also
Equivalent asynchronous getAsyncObjListWith method.
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
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()
-
def
quote(value: Any): String
- Attributes
- protected
- Definition Classes
- Quoted
-
def
quote2(value: Any): String
- Attributes
- protected
- Definition Classes
- Quoted
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toJavaList(scalaList: Seq[List[_]]): List[List[_]]
- Definition Classes
- JavaUtil
-
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()
-
object
Util
- Definition Classes
- JavaUtil

Documentation/API for the Molecule library - a meta DSL for the Datomic database.
scalamolecule.org | Github | Forum