[jboss-cvs] jboss-seam/src/main/org/jboss/seam/core ...

Gavin King gavin.king at jboss.com
Mon Jul 24 17:04:49 EDT 2006


  User: gavin   
  Date: 06/07/24 17:04:49

  Modified:    src/main/org/jboss/seam/core   ManagedEntity.java
                        ManagedHibernateEntity.java
  Log:
  minor adjustments
  
  Revision  Changes    Path
  1.5       +11 -9     jboss-seam/src/main/org/jboss/seam/core/ManagedEntity.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ManagedEntity.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/ManagedEntity.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- ManagedEntity.java	24 Jul 2006 20:55:57 -0000	1.4
  +++ ManagedEntity.java	24 Jul 2006 21:04:49 -0000	1.5
  @@ -24,9 +24,9 @@
      private EntityManager entityManager;
      private Object id;
      private String entityClass;
  +   private String idClass;
      private Object newInstance;
      private String idConverterId;
  -   private String idClass;
      private Converter idConverter;
      
      public EntityManager getEntityManager()
  @@ -82,19 +82,21 @@
      private Object getConvertedId() throws Exception
      {
         FacesContext facesContext = FacesContext.getCurrentInstance();
  -      if (idConverterId!=null)
  +      if (idConverter==null)
         {
  -         idConverter = facesContext.getApplication().createConverter(idConverterId); //cache the lookup
  -      }
  -      else if (idClass!=null)
  +         if (idConverterId==null)
         {
  +            //TODO: guess the id class using @Id
            idConverter = facesContext.getApplication().createConverter( Class.forName(idClass) );
         }
  +         else
  +         {
  +            idConverter = facesContext.getApplication().createConverter(idConverterId); //cache the lookup
  +         }
  +      }
         
         if (idConverter==null)
         {
  -         //TODO: look for an @Id annotation and guess the id type!
  -         //converter = facesContext.getApplication().createConverter(idClass)
            return id;
         }
         else
  
  
  
  1.6       +12 -10    jboss-seam/src/main/org/jboss/seam/core/ManagedHibernateEntity.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ManagedHibernateEntity.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/core/ManagedHibernateEntity.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- ManagedHibernateEntity.java	24 Jul 2006 20:55:57 -0000	1.5
  +++ ManagedHibernateEntity.java	24 Jul 2006 21:04:49 -0000	1.6
  @@ -23,9 +23,9 @@
      private Session session;
      private Serializable id;
      private String entityClass;
  +   private String idClass;
      private Object newInstance;
      private String idConverterId;
  -   private String idClass;
      private Converter idConverter;
      
      public Session getSession()
  @@ -78,22 +78,24 @@
      
      ////////////TODO: copy/paste from ManagedEntity ///////////////////
   
  -   private Serializable getConvertedId() throws ClassNotFoundException
  +   private Serializable getConvertedId() throws Exception
      {
         FacesContext facesContext = FacesContext.getCurrentInstance();
  -      if (idConverterId!=null)
  +      if (idConverter==null)
         {
  -         idConverter = facesContext.getApplication().createConverter(idConverterId); //cache the lookup
  -      }
  -      else if (idClass!=null)
  +         if (idConverterId==null)
         {
  +            //TODO: guess the id class using @Id
            idConverter = facesContext.getApplication().createConverter( Class.forName(idClass) );
         }
  +         else
  +         {
  +            idConverter = facesContext.getApplication().createConverter(idConverterId); //cache the lookup
  +         }
  +      }
         
         if (idConverter==null)
         {
  -         //TODO: look for an @Id annotation and guess the id type!
  -         //converter = facesContext.getApplication().createConverter(idClass)
            return id;
         }
         else
  
  
  



More information about the jboss-cvs-commits mailing list