[jbossseam-issues] [JBoss JIRA] Created: (JBSEAM-1325) Entity component does not properly cache Entity instances in application context

Chris Rudd (JIRA) jira-events at lists.jboss.org
Tue May 15 11:00:52 EDT 2007


Entity component does not properly cache Entity instances in application context
--------------------------------------------------------------------------------

                 Key: JBSEAM-1325
                 URL: http://jira.jboss.com/jira/browse/JBSEAM-1325
             Project: JBoss Seam
          Issue Type: Bug
    Affects Versions: 1.2.1.GA, 1.2.0.GA
            Reporter: Chris Rudd


The Entity.forClass method does not put the newly created Entity instance into the application context corectly. In the set its using set(name, model) instead of set(name,entity).

 public static Entity forClass(Class clazz)
   {
      if ( !Contexts.isApplicationContextActive() )
      {
         throw new IllegalStateException("No application context active");
      }
      
      String name = getModelName(clazz);
      Model model = (Model) Contexts.getApplicationContext().get(name);
      if ( model==null || !(model instanceof Entity) )
      {
         Entity entity = new Entity(clazz);
         Contexts.getApplicationContext().set(name, model);
         return entity;
      }
      else
      {
         return (Entity) model;
      }
   }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list