You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@isis.apache.org by Cesar Lugo <ce...@sisorg.com.mx> on 2015/10/09 00:27:47 UTC

Apache ISIS relationships

Hello again!

 

I have created an Apache ISIS prototype application, and in some cases I
need to have some Domain Entities that do not have any properties other than
references to other Domain Entities, for example, used just to build
Many-to-Many relationships among 2 Domain Entities (I am not using foreign
keys). For example, a Vendor can sell us many Items, and an Item can be
purchased by many Vendors. So I define a VendorItem entity, which has a
property to reference Item and Vendor entities within it. Everything works
fine, until I get to the collections (using SortedSet) on Item and on Vendor
to list all VendorItem relationships either from Item or from Vendor. In
that case, because VendorItem needs to be implemented using a Comparable
class, it requires a field for the CompareTo method. The only way I have
been able to work around it is to declare a property (vendorItemId) that I
don't really need, and populate it manually every time I create a new
VendorItem relationship. Is there a way to avoid using such a (vendorItemId)
property, or use the automatic "id" field generated by the JPO
idGeneratorStrategy.IDENTITY column = "id" annotation?. Or, is there any
other better way to manage Many-To-Many relationships using Apache ISIS and
JPO?

 

Cesar.

 

 

 

 

 

 



---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus