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

Gavin King gavin.king at jboss.com
Sun Jun 17 23:44:45 EDT 2007


  User: gavin   
  Date: 07/06/17 23:44:45

  Modified:    src/main/org/jboss/seam/persistence 
                        PersistenceProvider.java
  Log:
  javadoc
  
  Revision  Changes    Path
  1.11      +31 -0     jboss-seam/src/main/org/jboss/seam/persistence/PersistenceProvider.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: PersistenceProvider.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/persistence/PersistenceProvider.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -b -r1.10 -r1.11
  --- PersistenceProvider.java	18 Jun 2007 03:36:41 -0000	1.10
  +++ PersistenceProvider.java	18 Jun 2007 03:44:45 -0000	1.11
  @@ -33,26 +33,50 @@
   public class PersistenceProvider
   {
   
  +   /**
  +    *  Set the flush mode to manual-only flushing. Called when
  +    *  an atomic persistence context is required.
  +    */
      public void setFlushModeManual(EntityManager entityManager)
      {
         throw new UnsupportedOperationException("For use of FlushMode.MANUAL, please use Hibernate as the persistence provider or use a custom PersistenceProvider");
      }
   
  +   /**
  +    * Does the persistence context have unflushed changes? If
  +    * it does not, persistence context replication can be
  +    * optimized.
  +    * 
  +    * @return true to indicate that there are unflushed changes
  +    */
      public boolean isDirty(EntityManager entityManager)
      {
         return true; //best we can do!
      }
      
  +   /**
  +    * Get the value of the entity identifier attribute.
  +    * 
  +    * @param bean a managed entity instance
  +    */
      public Object getId(Object bean, EntityManager entityManager)
      {
         return Entity.forClass( bean.getClass() ).getIdentifier(bean);
      }
      
  +   /**
  +    * Enable a Filter. This is here just especially for Hibernate,
  +    * since we well know that other products don't have such cool
  +    * features. 
  +    */
      public void enableFilter(Filter f, EntityManager entityManager)
      {
         throw new UnsupportedOperationException("For filters, please use Hibernate as the persistence provider");
      }
      
  +   /**
  +    * Register a Synchronization with the current transaction.
  +    */
      public boolean registerSynchronization(Synchronization sync, EntityManager entityManager)
      {
         return false; //best we can do!
  @@ -63,6 +87,13 @@
         return (PersistenceProvider) Component.getInstance(PersistenceProvider.class, ScopeType.STATELESS);
      }
   
  +   /**
  +    * What flush policy should we use during the render response phase?
  +    * We should not be changing data during the render, so we can 
  +    * optimize performance by choosing not to flush.
  +    * 
  +    * @return COMMIT or MANUAL
  +    */
      public FlushModeType getRenderFlushMode()
      {
         return FlushModeType.COMMIT;
  
  
  



More information about the jboss-cvs-commits mailing list