Hi Josiah,
It's great to hear that you are working an a backend for Hibernate OGM!
Regarding ids, it should work for you if they are mapped using the IDENTITY
strategy:
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
Long id;
This causes the Hibernate ORM engine to read back the id value generated by
the datastore upon insertion. To make it work, your GridDialect for OGM
needs to implement the IdentityColumnAwareGridDialect facet [1]. You can
check out the MongoDB dialect for an example.
If this works and this kind of id generation is the only one which is
useful for Datomic (i.e. table/sequence strategies don't make any sense),
you may validate mapped entities by means of a SchemaDefiner [2] (an
experimental contract of OGM). An example is CouchDBSchemaDefiner.
Let us know how it goes or in case you run into any other issues.
--Gunnar
[1]
https://github.com/hibernate/hibernate-ogm/blob/master/core/src/main/java...
[2]
https://github.com/hibernate/hibernate-ogm/blob/master/couchdb/src/main/j...
2015-02-11 2:40 GMT+01:00 Haswell, Josiah D <Josiah.Haswell(a)ca.com>:
Hi folks,
I'm creating a Hibernate OGM implementation for Datomic, and I have a
question about IDs.
Say I have the entity
@Entity
public class Person {
@Id
@GeneratedValue
Long id;
}
In Datomic, you have to assign a temporary ID before submitting the
transaction. Datomic will then return the actual persistence ID after the
transaction has completed. My question is, how can I get the actual ID
back into the entity?
Thanks!
Josiah
_______________________________________________
hibernate-dev mailing list
hibernate-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/hibernate-dev