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

Gavin King gavin.king at jboss.com
Sun Oct 8 15:12:36 EDT 2006


  User: gavin   
  Date: 06/10/08 15:12:36

  Modified:    src/main/org/jboss/seam/framework   EntityHome.java
                        Home.java
  Log:
  better error reporting
  
  Revision  Changes    Path
  1.4       +10 -0     jboss-seam/src/main/org/jboss/seam/framework/EntityHome.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: EntityHome.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/framework/EntityHome.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- EntityHome.java	8 Oct 2006 18:57:45 -0000	1.3
  +++ EntityHome.java	8 Oct 2006 19:12:36 -0000	1.4
  @@ -11,6 +11,15 @@
   {
      private EntityManager entityManager;
   
  +   @Override
  +   public void validate()
  +   {
  +      if ( getEntityManager()==null )
  +      {
  +         throw new IllegalStateException("entityManager is null");
  +      }
  +   }
  +
      @In(create=true) 
      private FacesMessages facesMessages; 
      
  @@ -52,6 +61,7 @@
      }
      
      @Transactional
  +   @Override
      public E find()
      {
         getEntityManager().joinTransaction();
  
  
  
  1.3       +11 -0     jboss-seam/src/main/org/jboss/seam/framework/Home.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Home.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/framework/Home.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -b -r1.2 -r1.3
  --- Home.java	8 Oct 2006 18:57:45 -0000	1.2
  +++ Home.java	8 Oct 2006 19:12:36 -0000	1.3
  @@ -1,5 +1,7 @@
   package org.jboss.seam.framework;
   
  +import javax.annotation.PostConstruct;
  +
   import org.jboss.seam.annotations.Transactional;
   import org.jboss.seam.core.Expressions.ValueBinding;
   
  @@ -20,6 +22,15 @@
      private String createdMessage = "Successfully created";
      private String updatedMessage = "Successfully updated";
   
  +   @PostConstruct
  +   public void validate()
  +   {
  +      if ( getEntityClass()==null )
  +      {
  +         throw new IllegalStateException("entityClass is null");
  +      }
  +   }
  +
      @Transactional
      public E getInstance()
      {
  
  
  



More information about the jboss-cvs-commits mailing list