3 Replies Latest reply on Aug 10, 2006 3:00 AM by Carsten Hoehne

    Managed(Hibernate)Entity usage question

    Carsten Hoehne Master

      Hello,
      i do have 2 Manged Entitys set up:

      <component name="bazProject" class="org.jboss.seam.core.ManagedHibernateEntity">
       <property name="entityClass">de.bafz.lims.model.Project</property>
       <property name="session">#{bazDatabase}</property>
       <property name="id">#{bazProjectID}</property>
       <property name="idClass">java.lang.String</property>
       </component>
       <component name="bazExperiment" class="org.jboss.seam.core.ManagedHibernateEntity">
       <property name="entityClass">de.bafz.lims.model.Experiment</property>
       <property name="session">#{bazDatabase}</property>
       <property name="id">#{bazExperimentID}</property>
       <property name="idClass">java.lang.Long</property>
       </component>
      

      I can use bazProject as expected. i define an attribute like so
      @Out(required=false,scope=ScopeType.SESSION)
       String bazProjectID;
      

      and in a method of my bean bazProjectID is set.


      But with bazExperiment i have trouble.
      1. question
      What type must the bazExperimentID be?
      I suppose java.lang.String

      @Out(required=false,scope=ScopeType.SESSION)
       private String bazExperimentID;
      

      setting the attribute like so
      bazExperimentID=getExperiment().getId().toString();


      After this bazExperimentID is in the session but accessing bazExperiment is ever null. Debuging my app tell me that getInstance from Managed(Hibernate)Entity is never called.

      What is wrong with bazExperiment?
      The only difference is that bazProject is used in an html page while bazExperiment is not.
      Ciao,
      Carsten