1 Reply Latest reply on Feb 27, 2002 1:27 AM by Dain Sundstrom

    How powerful the JBossCMP is?

    Tadej Newbie

      Hi,

      I am deciding if our next projects should use the BMP or the CMP (which in case of JBoss is JBossCMP). There sure are advantages, that simplify the programers life when trying to develop an eneterprise app with a persistence leyer using CMP, but from our past experiences we figured out that an O-R maping mechanism should support some crutial features. I would like to ask the JBossCMP gurus which of those features are supported by JBossCMP and how are achived:

      1. Inheritance: table FEMALE extends PERSON and so adds some specific fields to those inherited from it. It shares the same ID. Is it posible to represent it as one persistent EJB - FemaleBean?

      2. Lazy readnig - Reference entities are read from the persistence store if and only if they are realy needed. (I belive I saw somewhere that this feature is supporded with an XML tag in the jbosscmp-jdbc.xml???)

      3. Id management - Automatic creation and arranging of table IDs when creating new EJB instances.

      4. Optimistic locking - the update of an persistent object does not succeed if there was a change in the entity between read and save (When using value type objects). Uses special locking field.

      5. Logical deletion - records from the DB are not really deleted when an entity EJB is removed. Only the deleted field is set to 1. Such EJBs wond be retrived any more when calling findAll() on the home object.

      If I forgot some crutial features please mention those too.

      Thanks, Tadej.

        • 1. Re: How powerful the JBossCMP is?
          Dain Sundstrom Master

          > 1. Inheritance: table FEMALE extends PERSON and so
          > adds some specific fields to those inherited from it.
          > It shares the same ID. Is it posible to represent it
          > as one persistent EJB - FemaleBean?

          You really think you need this? The only tool that I know that suports this is Toplink, so you will have to get out the checkbook. =)

          I think db inheritance is lame so don't expect it any time soon from me. You could create a person ejb and a female ejb that has a one-to-one cascade-delete relationship with person.

          > 2. Lazy readnig - Reference entities are read from
          > the persistence store if and only if they are realy
          > needed. (I belive I saw somewhere that this feature
          > is supporded with an XML tag in the
          > jbosscmp-jdbc.xml???)

          Always has it, always will.

          > 3. Id management - Automatic creation and arranging
          > of table IDs when creating new EJB instances.

          On the 3.0 final todo list. Will be implemented using a plugable factory pattern.

          > 4. Optimistic locking - the update of an persistent
          > object does not succeed if there was a change in the
          > entity between read and save (When using value type
          > objects). Uses special locking field.

          On the todo list it time permits.

          > 5. Logical deletion - records from the DB are not
          > really deleted when an entity EJB is removed. Only
          > the deleted field is set to 1. Such EJBs wond be
          > retrived any more when calling findAll() on the home
          > object.

          Did you mean wouldn't be retrieved? No plans for this.

          > If I forgot some crutial features please mention
          > those too.

          Dynamic-QL