I'm going over this article on CMR http://technology.amis.nl/blog/index.php?p=90&page=3. The following code demonstrates how XDoclet is used to establish relationship between two entity beans:
... other stuff ... /** * * * @ejb.interface-method * * @ejb.relation * name="bibliography-may-contain-article” * role-name="BibliographyToArticle” * cascade-delete="yes” * target-cascade-delete="yes” * target-role-name="ArticleToBibliography” * target-ejb="Article” * * @jboss.target-relation * related-pk-field="publicationID” * fk-column="publication_id_fk” */ public abstract ArticleLocal getArticle(); ... other stuff ...
it will be the class of the composite primary key, database will store it as BLOB