3 Replies Latest reply on Oct 20, 2003 10:43 PM by nraghuram

    RO/RW pattern and Cache invalidation

    navjot_m Newbie

      Hello,

      I am trying to implement the RO/RW pattern presented as a case study in the JBoss clustering documentation in "Cache Invalidation" chapter. I have attached the relevant code snippets. The DomainClassROBean is the read only version for DomainClassBean. What I notice when I run the "findAll" method are the SQL statements:

      First time it is run:

      2003-10-16 18:44:09,347 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.DomainClassRO.findAll] Executing SQL: SELECT t0_dc.id FROM DomainClass t0_dc
      2003-10-16 18:44:09,382 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.DomainClassRO] Executing SQL: SELECT id,version, name, type FROM DomainClass WHERE (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?) OR (id=?)

      And for every subsequent call, the following:

      2003-10-16 18:44:09,587 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.DomainClassRO.findAll] Executing SQL: SELECT t0_dc.id FROM DomainClass t0_dc

      My question is, why does it call the SQL at all second time if this is a cached bean with all attributes read only! I am not using clustering.

      Thanks,
      Navjot

      =================================

      The form is not letting me attach, so I am including the relevant code in the post:

      jboss.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">



      <enterprise-beans>



      <ejb-name>Domain</ejb-name>
      <local-jndi-name>ejb/DomainHomeLocal</local-jndi-name>
      <configuration-name>Standard CMP 2.x EntityBean with cache invalidation</configuration-name>
      <cache-invalidation>true</cache-invalidation>
      <cache-invalidation-config>
      <invalidation-group-name>DomainCacheGroup</invalidation-group-name>
      </cache-invalidation-config>

      <method-attributes>
      </method-attributes>



      <ejb-name>DomainRO</ejb-name>
      <local-jndi-name>ejb/DomainROHomeLocal</local-jndi-name>
      <read-only>true</read-only>
      <configuration-name>Standard CMP 2.x EntityBean with cache invalidation</configuration-name>
      <cache-invalidation>true</cache-invalidation>
      <cache-invalidation-config>
      <invalidation-group-name>DomainCacheGroup</invalidation-group-name>
      </cache-invalidation-config>

      <method-attributes>
      </method-attributes>



      <ejb-name>DomainClassRO</ejb-name>
      <local-jndi-name>ejb/DomainClassROHomeLocal</local-jndi-name>
      <read-only>true</read-only>
      <configuration-name>Standard CMP 2.x EntityBean with cache invalidation</configuration-name>
      <cache-invalidation>true</cache-invalidation>
      <cache-invalidation-config>
      <invalidation-group-name>DomainClassCacheGroup</invalidation-group-name>
      </cache-invalidation-config>

      <method-attributes>
      </method-attributes>



      <ejb-name>DomainClass</ejb-name>
      <local-jndi-name>ejb/DomainClassHomeLocal</local-jndi-name>
      <configuration-name>Standard CMP 2.x EntityBean with cache invalidation</configuration-name>
      <cache-invalidation>true</cache-invalidation>
      <cache-invalidation-config>
      <invalidation-group-name>DomainClassCacheGroup</invalidation-group-name>
      </cache-invalidation-config>

      <method-attributes>

      <method-name>get*</method-name>
      <read-only>true</read-only>

      </method-attributes>


      </enterprise-beans>

      <resource-managers>
      </resource-managers>



      ====================================

      jbosscmp-jdbc.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">

      <jbosscmp-jdbc>



      <enterprise-beans>




      <ejb-name>Domain</ejb-name>
      <table-name>Domain</table-name>

      <cmp-field>
      <field-name>id</field-name>
      <column-name>id</column-name>

      <auto-increment/>
      </cmp-field>
      <cmp-field>
      <field-name>version</field-name>
      <column-name>version</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      <column-name>name</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>state</field-name>
      <column-name>state</column-name>

      </cmp-field>

      <entity-command name="mysql-get-generated-keys">
      </entity-command>
      <!-- jboss 3.2 features -->
      <!-- optimistic locking does not express the exclusions needed -->



      <ejb-name>DomainRO</ejb-name>
      <read-only>true</read-only>
      <table-name>Domain</table-name>

      <cmp-field>
      <field-name>id</field-name>
      <column-name>id</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>version</field-name>
      <column-name>version</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      <column-name>name</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>state</field-name>
      <column-name>state</column-name>

      </cmp-field>

      <!-- jboss 3.2 features -->
      <!-- optimistic locking does not express the exclusions needed -->


      <ejb-name>DomainClassRO</ejb-name>
      <read-only>true</read-only>
      <table-name>DomainClass</table-name>

      <cmp-field>
      <field-name>id</field-name>
      <column-name>id</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>version</field-name>
      <column-name>version</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      <column-name>name</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>type</field-name>
      <column-name>type</column-name>

      </cmp-field>

      <!-- jboss 3.2 features -->
      <!-- optimistic locking does not express the exclusions needed -->


      <ejb-name>DomainClass</ejb-name>
      <table-name>DomainClass</table-name>

      <cmp-field>
      <field-name>id</field-name>
      <column-name>id</column-name>

      <auto-increment/>
      </cmp-field>
      <cmp-field>
      <field-name>version</field-name>
      <column-name>version</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      <column-name>name</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>type</field-name>
      <column-name>type</column-name>

      </cmp-field>

      <entity-command name="mysql-get-generated-keys">
      </entity-command>
      <!-- jboss 3.2 features -->
      <!-- optimistic locking does not express the exclusions needed -->


      </enterprise-beans>


      <ejb-relation>
      <ejb-relation-name>DomainClass-Domain</ejb-relation-name>

      <ejb-relationship-role>
      <ejb-relationship-role-name>Domain-is_of_class-DomainClass</ejb-relationship-role-name>
      <key-fields/>

      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>DomainClass-has_domains-Domains</ejb-relationship-role-name>
      <key-fields>
      <key-field>
      <field-name>id</field-name>
      <column-name>domainClassId</column-name>
      </key-field>
      </key-fields>

      </ejb-relationship-role>
      </ejb-relation>
      <ejb-relation>
      <ejb-relation-name>DomainClassRO-DomainRO</ejb-relation-name>

      <ejb-relationship-role>
      <ejb-relationship-role-name>DomainRO-is_of_class-DomainClassRO</ejb-relationship-role-name>
      <key-fields/>

      </ejb-relationship-role>
      <ejb-relationship-role>
      <ejb-relationship-role-name>DomainClassRO-has_domains-DomainsRO</ejb-relationship-role-name>
      <key-fields>
      <key-field>
      <field-name>id</field-name>
      <column-name>domainClassId</column-name>
      </key-field>
      </key-fields>

      </ejb-relationship-role>
      </ejb-relation>


      </jbosscmp-jdbc>

      =====================================

      ejb-jar.xml:

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      <ejb-jar >

      <![CDATA[No Description.]]>
      <display-name>Generated by XDoclet</display-name>

      <enterprise-beans>

      <!-- Entity Beans -->

      <![CDATA[Entity bean representing the domain.]]>

      <ejb-name>Domain</ejb-name>

      <local-home>com.CapitalOne.COPOSEDiC.ejb.domain.interfaces.DomainLocalHome</local-home>
      com.CapitalOne.COPOSEDiC.ejb.domain.interfaces.DomainLocal

      <ejb-class>com.CapitalOne.COPOSEDiC.ejb.domain.DomainBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Long</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>Domain</abstract-schema-name>
      <cmp-field >
      <![CDATA[Unique id for the parameter.]]>
      <field-name>id</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Version number]]>
      <field-name>version</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Name of parameter.]]>
      <field-name>name</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[State of the domain]]>
      <field-name>state</field-name>
      </cmp-field>
      <primkey-field>id</primkey-field>

      <ejb-local-ref >
      <ejb-ref-name>ejb/DomainClassLocal</ejb-ref-name>
      <ejb-ref-type>Entity</ejb-ref-type>
      <local-home>com.CapitalOne.COPOSEDiC.ejb.domain.interfaces.DomainClassLocalHome</local-home>
      com.CapitalOne.COPOSEDiC.ejb.domain.interfaces.DomainClassLocal
      <ejb-link>DomainClass</ejb-link>
      </ejb-local-ref>

      <!-- Write a file named ejb-finders-DomainBean.xml if you want to define extra finders. -->


      <![CDATA[Entity bean representing the (read-only) domain.]]>

      <ejb-name>DomainRO</ejb-name>

      <local-home>com.CapitalOne.COPOSEDiC.ejb.domain.interfaces.RO.DomainROLocalHome</local-home>
      com.CapitalOne.COPOSEDiC.ejb.domain.interfaces.RO.DomainROLocal

      <ejb-class>com.CapitalOne.COPOSEDiC.ejb.domain.RO.DomainROBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Long</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>DomainRO</abstract-schema-name>
      <cmp-field >
      <![CDATA[Unique id for the parameter.]]>
      <field-name>id</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Version number]]>
      <field-name>version</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Name of parameter.]]>
      <field-name>name</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[State of the domain]]>
      <field-name>state</field-name>
      </cmp-field>
      <primkey-field>id</primkey-field>


      <query-method>
      <method-name>findAll</method-name>
      <method-params>
      </method-params>
      </query-method>
      <ejb-ql><![CDATA[SELECT OBJECT(d) FROM DomainRO AS d]]></ejb-ql>

      <!-- Write a file named ejb-finders-DomainROBean.xml if you want to define extra finders. -->



      <![CDATA[Entity bean representing the (read only) domain class.]]>

      <ejb-name>DomainClassRO</ejb-name>

      <local-home>com.CapitalOne.COPOSEDiC.ejb.domain.interfaces.RO.DomainClassROLocalHome</local-home>
      com.CapitalOne.COPOSEDiC.ejb.domain.interfaces.RO.DomainClassROLocal

      <ejb-class>com.CapitalOne.COPOSEDiC.ejb.domain.RO.DomainClassROBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Long</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>DomainClassRO</abstract-schema-name>
      <cmp-field >
      <![CDATA[Unique id for the domain class.]]>
      <field-name>id</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Version number]]>
      <field-name>version</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Name of domain class.]]>
      <field-name>name</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Type of the domain class.]]>
      <field-name>type</field-name>
      </cmp-field>
      <primkey-field>id</primkey-field>


      <query-method>
      <method-name>findAll</method-name>
      <method-params>
      </method-params>
      </query-method>
      <ejb-ql><![CDATA[SELECT OBJECT(dc) FROM DomainClassRO AS dc]]></ejb-ql>


      <query-method>
      <method-name>findByName</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql><![CDATA[SELECT OBJECT(dc) FROM DomainClassRO AS dc WHERE dc.name = ?1]]></ejb-ql>

      <!-- Write a file named ejb-finders-DomainClassROBean.xml if you want to define extra finders. -->



      <![CDATA[Entity bean representing the domain class.]]>

      <ejb-name>DomainClass</ejb-name>

      <local-home>com.CapitalOne.COPOSEDiC.ejb.domain.interfaces.DomainClassLocalHome</local-home>
      com.CapitalOne.COPOSEDiC.ejb.domain.interfaces.DomainClassLocal

      <ejb-class>com.CapitalOne.COPOSEDiC.ejb.domain.DomainClassBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Long</prim-key-class>
      False
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>DomainClass</abstract-schema-name>
      <cmp-field >
      <![CDATA[Unique id for the domain class.]]>
      <field-name>id</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Version number]]>
      <field-name>version</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Name of domain class.]]>
      <field-name>name</field-name>
      </cmp-field>
      <cmp-field >
      <![CDATA[Type of the domain class.]]>
      <field-name>type</field-name>
      </cmp-field>
      <primkey-field>id</primkey-field>

      <!-- Write a file named ejb-finders-DomainClassBean.xml if you want to define extra finders. -->


      </enterprise-beans>

      <!-- Relationships -->

      <ejb-relation >
      <ejb-relation-name>DomainClass-Domain</ejb-relation-name>

      <ejb-relationship-role >
      <ejb-relationship-role-name>Domain-is_of_class-DomainClass</ejb-relationship-role-name>
      Many
      <relationship-role-source >
      <ejb-name>Domain</ejb-name>
      </relationship-role-source>
      <cmr-field >
      <cmr-field-name>domainClass</cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>

      <ejb-relationship-role >
      <ejb-relationship-role-name>DomainClass-has_domains-Domains</ejb-relationship-role-name>
      One
      <relationship-role-source >
      <ejb-name>DomainClass</ejb-name>
      </relationship-role-source>
      <cmr-field >
      <cmr-field-name>domains</cmr-field-name>
      <cmr-field-type>java.util.Collection</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>

      </ejb-relation>
      <ejb-relation >
      <ejb-relation-name>DomainClassRO-DomainRO</ejb-relation-name>

      <ejb-relationship-role >
      <ejb-relationship-role-name>DomainRO-is_of_class-DomainClassRO</ejb-relationship-role-name>
      Many
      <relationship-role-source >
      <ejb-name>DomainRO</ejb-name>
      </relationship-role-source>
      <cmr-field >
      <cmr-field-name>domainClass</cmr-field-name>
      </cmr-field>
      </ejb-relationship-role>

      <ejb-relationship-role >
      <ejb-relationship-role-name>DomainClassRO-has_domains-DomainsRO</ejb-relationship-role-name>
      One
      <relationship-role-source >
      <ejb-name>DomainClassRO</ejb-name>
      </relationship-role-source>
      <cmr-field >
      <cmr-field-name>domains</cmr-field-name>
      <cmr-field-type>java.util.Collection</cmr-field-type>
      </cmr-field>
      </ejb-relationship-role>

      </ejb-relation>


      <!-- Assembly Descriptor -->
      <assembly-descriptor >
      </assembly-descriptor>

      </ejb-jar>

      =================================

      DomainClassBean.java:

      /*
      * Created on Sep 11, 2003
      *
      */
      package com.CapitalOne.COPOSEDiC.ejb.domain;

      import java.util.Collection;
      import javax.ejb.*;
      import com.CapitalOne.COPOSEDiC.DTO.DomainClassDTO;

      /**
      * Entity bean representing the domain class.
      *
      * @author nmar3921
      *
      * @ejb.bean
      * name = "DomainClass"
      * schema = "DomainClass"
      * local-jndi-name = "ejb/DomainClassHomeLocal"
      * view-type = "local"
      * type = "CMP"
      * cmp-version = "2.x"
      * primkey-field = "id"
      * @ejb.persistence
      * table-name = "DomainClass"
      *
      * @jboss.entity-command
      * name = "mysql-get-generated-keys"
      * @jboss.container-configuration
      * name = "Standard CMP 2.x EntityBean with cache invalidation"
      * @jboss.cache-invalidation
      * value = "true"
      * @jboss.cache-invalidation-config
      * invalidation-group-name = "DomainClassCacheGroup"
      * @jboss.method-attributes
      * pattern = "get*"
      * read-only = "true"
      */
      public abstract class DomainClassBean implements EntityBean {

      /** Reference to EntityContext */
      protected EntityContext entityContext = null;

      /*
      ***** CREATE CREATE CREATE *****
      */

      /**
      * Create a new domain class entity.
      *
      * @ejb.create-method
      */
      public Long ejbCreate(DomainClassDTO domainClassDTO) throws CreateException {
      setName(domainClassDTO.getName());
      setType(domainClassDTO.getType());
      setVersion(new Integer(1));
      return null;
      }

      /**
      * Create a new domain class entity.
      *
      */
      public void ejbPostCreate(DomainClassDTO domainClassDTO) throws CreateException {

      }

      /*
      ***** CMP CMP CMP CMP CMP *****
      */

      /**
      * Unique id for the domain class.
      *
      * @ejb.persistence
      * column-name = "id"
      * @ejb.pk-field
      * @ejb.interface-method
      *
      * @jboss.persistence
      * auto-increment = "true"
      */
      public abstract Long getId();

      /**
      *
      */
      public abstract void setId(Long id);

      /**
      * Version number
      *
      * @ejb.persistence
      * column-name = "version"
      * @ejb.interface-method
      */
      public abstract Integer getVersion();

      /**
      * Version number
      *
      * @param version
      *
      * @ejb.interface-method
      */
      public abstract void setVersion(Integer version);

      /**
      * Name of domain class.
      *
      * @ejb.persistence
      * column-name = "name"
      * @ejb.interface-method
      */
      public abstract String getName();

      /**
      * Name of domain class.
      *
      * @ejb.interface-method
      */
      public abstract void setName(String name);

      /**
      * Type of the domain class.
      *
      * @return
      *
      * @ejb.persistence
      * column-name = "type"
      * @ejb.interface-method
      */
      public abstract String getType();

      /**
      * Type of domain class.
      *
      * @param type
      *
      * @ejb.interface-method
      */
      public abstract void setType(String type);

      /*
      ***** CMR CMR CMR CMR CMR *****
      */

      /**
      * Domains in this domain class.
      *
      * @ejb.relation
      * name = "DomainClass-Domain"
      * role-name = "DomainClass-has_domains-Domains"
      *
      * @ejb.interface-method
      */
      public abstract Collection getDomains();

      /**
      * Domains in this domain class.
      *
      * @param domains
      *
      * @ejb.interface-method
      */
      public abstract void setDomains(Collection domains);

      /*
      ***** METHODS METHODS METHODS METHODS *****
      */

      /**
      * @ejb.interface-method
      */
      public void incrementVersion(){
      this.setVersion(new Integer(this.getVersion().intValue()+1));
      }

      /*
      * EJB LIFE_CYCLE METHODS
      */

      public void ejbActivate() {
      }

      public void ejbLoad() {
      }

      public void ejbPassivate() {
      }

      public void ejbRemove() {
      }

      public void ejbStore() {
      }

      public void setEntityContext(EntityContext ctx) {
      entityContext = ctx;
      }

      public void unsetEntityContext() {
      }
      }

      ===============================

      DomainClassROBean.java:

      /*
      * Created on Sep 11, 2003
      *
      */
      package com.CapitalOne.COPOSEDiC.ejb.domain.RO;

      import java.util.Collection;
      import javax.ejb.*;

      /**
      * Entity bean representing the (read only) domain class.
      *
      * @author nmar3921
      *
      * @ejb.bean
      * name = "DomainClassRO"
      * schema = "DomainClassRO"
      * local-jndi-name = "ejb/DomainClassROHomeLocal"
      * view-type = "local"
      * type = "CMP"
      * cmp-version = "2.x"
      * primkey-field = "id"
      * @ejb.persistence
      * table-name = "DomainClass"
      * @ejb.finder
      * signature = "java.util.Collection findAll()"
      * query = "SELECT OBJECT(dc) FROM DomainClassRO AS dc"
      * @ejb.finder
      * signature = "com.CapitalOne.COPOSEDiC.ejb.domain.interfaces.RO.DomainClassROLocal findByName(java.lang.String name)"
      * query = "SELECT OBJECT(dc) FROM DomainClassRO AS dc WHERE dc.name = ?1"
      *
      * @jboss.persistence
      * read-only = "true"
      * @jboss.read-only
      * read-only = "true"
      * @jboss.container-configuration
      * name = "Standard CMP 2.x EntityBean with cache invalidation"
      * @jboss.cache-invalidation
      * value = "true"
      * @jboss.cache-invalidation-config
      * invalidation-group-name = "DomainClassCacheGroup"
      */
      public abstract class DomainClassROBean implements EntityBean {

      /** Reference to EntityContext */
      protected EntityContext entityContext = null;

      /*
      ***** CREATE CREATE CREATE *****
      */

      /**
      * Create a new domain class entity.
      *
      * @ejb.create-method
      */
      public Long ejbCreate() throws CreateException {
      return null;
      }

      /**
      * Create a new domain class entity.
      *
      */
      public void ejbPostCreate() throws CreateException {
      }

      /*
      ***** CMP CMP CMP CMP CMP *****
      */

      /**
      * Unique id for the domain class.
      *
      * @ejb.persistence
      * column-name = "id"
      * @ejb.pk-field
      * @ejb.interface-method
      */
      public abstract Long getId();

      /**
      *
      */
      public abstract void setId(Long id);

      /**
      * Version number
      *
      * @ejb.persistence
      * column-name = "version"
      * @ejb.interface-method
      */
      public abstract Integer getVersion();

      /**
      * Version number
      *
      * @param version
      */
      public abstract void setVersion(Integer version);

      /**
      * Name of domain class.
      *
      * @ejb.persistence
      * column-name = "name"
      * @ejb.interface-method
      */
      public abstract String getName();

      /**
      * Name of domain class.
      */
      public abstract void setName(String name);

      /**
      * Type of the domain class.
      *
      * @return
      *
      * @ejb.persistence
      * column-name = "type"
      * @ejb.interface-method
      */
      public abstract String getType();

      /**
      * Type of domain class.
      *
      * @param type
      */
      public abstract void setType(String type);

      /*
      ***** CMR CMR CMR CMR CMR *****
      */

      /**
      * Domains in this domain class.
      *
      * @ejb.relation
      * name = "DomainClassRO-DomainRO"
      * role-name = "DomainClassRO-has_domains-DomainsRO"
      *
      * @ejb.interface-method
      */
      public abstract Collection getDomains();

      /**
      * Domains in this domain class.
      *
      * @param domains
      */
      public abstract void setDomains(Collection domains);

      /*
      * EJB LIFE_CYCLE METHODS
      */

      public void ejbActivate() {
      }

      public void ejbLoad() {
      }

      public void ejbPassivate() {
      }

      public void ejbRemove() {
      }

      public void ejbStore() {
      }

      public void setEntityContext(EntityContext ctx) {
      entityContext = ctx;
      }

      public void unsetEntityContext() {
      }
      }