EJB CMP/CMR example with JBoss+Xdoclet
ArticleBean, there is not much special, since the relation mapping is unidirectional. If it would have been bidirectional, we would have found similar Xdoclet tags, where we would have paid special attention on the fact that the name of the relationship was equal in both files. Since we will see this in a forthcoming post on one-to-many relationship mappings, I’ll postpone it here.
The only remarkable thing may be that I managed to assign the foreign-key in the
ArticleBean a primary-key role at the same time! Of course, this is possible because of the one-to-one mapping only.
/** * Returns the publicationIDfk * @return the publicationIDfk * * @ejb.persistent-field * @ejb.persistence * column-name="publication_id_fk" * sql-type="VARCHAR" * @ejb.pk-field * @ejb.interface-method * */ public abstract java.lang.String getPublicationIDfk(); /** * Sets the publicationIDfk * * @param java.lang.String the new publicationIDfk value * * @ejb.interface-method */ public abstract void setPublicationIDfk(java.lang.String publicationIDfk);