On Wed, Aug 19, 2009 at 10:26 PM, Alex Shneyderman<[email protected]> wrote: > o.q.s.e.h.EntityStoreSPI#getEntityState has a o.q.a.e.EntityReference > as an argument. How does one determine entity type out of this ? In > JDBM it seems not matter since the whole object is serialized in the > store, for QRM it would be good to know this up-front, so one knows > what table to query and avoid any trickery.
It can't know it... It becomes an issue for the ES to figure out the entity type from the Identity, as discussed in recent thread with Phil. To explain; The UoW is given a MixinType that the client wants to retrieve, and that will mean that all Entity types that has that Mixin implemented will be a possible return type. The UoW has no way to know this in a generic fashion. The ES could require that Identities are formatted with entity types according to some syntax, and to ensure such syntax it is easiest if the IdentityGenerator service is implemented by the ES as well. For existing SQL databases there will be a little bit of bootstrapping messiness, as the must be some hardcode identities that the application knows of. But otherwise, the entity type information can be redundant and therefor be stripped when going into the SQL tables. Does that makes sense? Cheers -- Niclas Hedhman, Software Developer http://www.qi4j.org - New Energy for Java I live here; http://tinyurl.com/2qq9er I work here; http://tinyurl.com/2ymelc I relax here; http://tinyurl.com/2cgsug _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

