Hi guys,

Values can now have Associations. Internally they are always stored as id's and when you do a get() (or use ManyAssociation access methods) they will be resolved against the current UoW.

They are included in JSON as expected, i.e. as identifiers. ManyAssociations becomes JSON arrays.

This can be very useful to handle graphs of objects on the serverside in Entity state, which before required Property<EntityReference> instead, or similar manual handling.

Note that it requires an active UoW to work, so won't really work for client code that does not have the entities available locally.

Example:
    public interface AssociationValue
        extends ValueComposite
    {
        @Optional
        Association<SomeEntity> some();

        ManyAssociation<SomeEntity> manySome();
    }

    public interface SomeEntity
        extends EntityComposite
    {
        Property<AssociationValue> someValue();
    }
---

Enjoy!

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to