EJB CMP/CMR example with JBoss+Xdoclet javacode 9085791

EJB CMP/CMR example with JBoss+Xdoclet

For the 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);

14 Comments

  1. CMR October 26, 2006
  2. Carola December 22, 2005
  3. Jens Wurm November 17, 2005
  4. Breno Leitao February 24, 2005
  5. Arne v.Irmer December 6, 2004
  6. Arne v.Irmer November 30, 2004
  7. Zeger Hendrikse November 23, 2004
  8. Arne v.Irmer November 23, 2004
  9. Arne v.Irmer November 23, 2004
  10. Zeger Hendrikse November 8, 2004
  11. Matt Robinson November 8, 2004
  12. ss October 19, 2004
  13. Janos Czako September 2, 2004
  14. Zeger Hendrikse August 2, 2004