On Thu, Nov 13, 2008 at 6:35 AM, Philipp Meier <[EMAIL PROTECTED]> wrote:
> I want to model a ManyAssociation wich is qualified by a simple type. > E.g. a Entity which has a ManyAssociation to instances of another entity > type where the instances are qualified by Integer values. Think of a > Person entity having qualified associations to a Contact entity. > > Currently a qualifier (in Qualifier) must be an entity, too. Is this > correct? If yes, what's the design decision behind this? I might misunderstand the question; But your statement "ManyAssociation to instances of another entity" is spot on! You reference another Entity. Qi4j will handle all kinds of things under the hood and still ensure that when you request that referenced Entity it will be there. Lazy/Eager loading, traversal of the graph and even indexing. Without a strict model, Qi4j would become just as bad and nasty as Hibernate. If you want to store Integers in a List, which "somehow" can be queried into other entities, then you are on your own. We have EntityStores that are relationship aware, and can highly optimize the association bindings and not rely on SQL queries to resolve them. Furthermore, by having a extremely tight definition of what Association really is (unlike most ORM solutions) we have a simpler, faster, more robust techonolgy, and as a side effect(!) more flexible to all kinds of storage mechanisms. The 'reference' in the association is effectively a URI, which is a key ingredient in the handshake between the EntityStore and the UnitOfWork. That handshake is slightly 'over the top' for the local JVM case, but exactly the same mechanics are used for cross-JVM communication... The ES can be on a separate host, without having any domain code present. Cheers Niclas _______________________________________________ qi4j-dev mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/qi4j-dev

