users@glassfish.java.net

Re: Relationship navigation in java code failing to get properly

From: <glassfish_at_javadesktop.org>
Date: Fri, 23 Feb 2007 15:39:32 PST

Marina, here's some more into to answer your question

Asset {
  @ManyToOne
  AssetClass assetClass;

  @OneToMany(mappedBy="owningAsset")
  List<AssetProperty> properties = new ArrayList<AssetProperty>();
}

AssetProperty {
  @ManyToOne
  AssetPropretyType type;

  @ManyToOne
  Asset asset;
}

In short: Asset objects have an AssetClass which describes an Asset. The AssetClass has a list of AssetPropertyType objects which describe the properties that assets of that AssetClass may have.

The Asset has a list of AssetProperty objects which have an AssetPropertyType.
[Message sent by forum member 'jeffreyrodriguez' (jeffreyrodriguez)]

http://forums.java.net/jive/thread.jspa?messageID=205071