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

Gavin King gavin.king at jboss.com
Sun Jul 8 06:54:06 EDT 2007


  User: gavin   
  Date: 07/07/08 06:54:06

  Modified:    src/main/org/jboss/seam/persistence 
                        HibernateSessionProxy.java
  Log:
  needed for DetachedCriteria
  
  Revision  Changes    Path
  1.4       +245 -3    jboss-seam/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: HibernateSessionProxy.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- HibernateSessionProxy.java	22 Jun 2007 06:53:54 -0000	1.3
  +++ HibernateSessionProxy.java	8 Jul 2007 10:54:05 -0000	1.4
  @@ -2,6 +2,9 @@
   
   import java.io.Serializable;
   import java.sql.Connection;
  +import java.util.Iterator;
  +import java.util.List;
  +import java.util.Map;
   
   import org.hibernate.CacheMode;
   import org.hibernate.Criteria;
  @@ -9,23 +12,41 @@
   import org.hibernate.Filter;
   import org.hibernate.FlushMode;
   import org.hibernate.HibernateException;
  +import org.hibernate.Interceptor;
   import org.hibernate.LockMode;
   import org.hibernate.Query;
   import org.hibernate.ReplicationMode;
   import org.hibernate.SQLQuery;
  +import org.hibernate.ScrollMode;
  +import org.hibernate.ScrollableResults;
   import org.hibernate.Session;
   import org.hibernate.SessionFactory;
   import org.hibernate.Transaction;
  +import org.hibernate.collection.PersistentCollection;
  +import org.hibernate.engine.EntityKey;
  +import org.hibernate.engine.PersistenceContext;
  +import org.hibernate.engine.QueryParameters;
  +import org.hibernate.engine.SessionFactoryImplementor;
  +import org.hibernate.engine.SessionImplementor;
  +import org.hibernate.engine.query.sql.NativeSQLQuerySpecification;
  +import org.hibernate.event.EventListeners;
  +import org.hibernate.impl.CriteriaImpl;
  +import org.hibernate.jdbc.Batcher;
  +import org.hibernate.jdbc.JDBCContext;
  +import org.hibernate.loader.custom.CustomQuery;
  +import org.hibernate.persister.entity.EntityPersister;
   import org.hibernate.stat.SessionStatistics;
  +import org.hibernate.type.Type;
   
   /**
  - * Proxies the EntityManager, and implements EL interpolation
  - * in HQL
  + * Proxies the Session, and implements EL interpolation
  + * in HQL. Needs to implement SessionImplementor because
  + * DetachedCriteria casts the Session to SessionImplementor.
    * 
    * @author Gavin King
    *
    */
  -public class HibernateSessionProxy implements Session
  +public class HibernateSessionProxy implements Session, SessionImplementor
   {
      private Session delegate;
   
  @@ -374,4 +395,225 @@
      {
         delegate.update(arg0, arg1);
      }
  +   
  +   private SessionImplementor getDelegateSessionImplementor()
  +   {
  +      return (SessionImplementor) delegate;
  +   }
  +
  +   public void afterScrollOperation()
  +   {
  +      getDelegateSessionImplementor().afterScrollOperation();
  +   }
  +
  +   public void afterTransactionCompletion(boolean arg0, Transaction arg1)
  +   {
  +      getDelegateSessionImplementor().afterTransactionCompletion(arg0, arg1);
  +   }
  +
  +   public void beforeTransactionCompletion(Transaction arg0)
  +   {
  +      getDelegateSessionImplementor().beforeTransactionCompletion(arg0);
  +   }
  +
  +   public String bestGuessEntityName(Object arg0)
  +   {
  +      return getDelegateSessionImplementor().bestGuessEntityName(arg0);
  +   }
  +
  +   public int executeNativeUpdate(NativeSQLQuerySpecification arg0, QueryParameters arg1) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().executeNativeUpdate(arg0, arg1);
  +   }
  +
  +   public int executeUpdate(String arg0, QueryParameters arg1) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().executeUpdate(arg0, arg1);
  +   }
  +
  +   public Batcher getBatcher()
  +   {
  +      return getDelegateSessionImplementor().getBatcher();
  +   }
  +
  +   public Serializable getContextEntityIdentifier(Object arg0)
  +   {
  +      return getDelegateSessionImplementor().getContextEntityIdentifier(arg0);
  +   }
  +
  +   public int getDontFlushFromFind()
  +   {
  +      return getDelegateSessionImplementor().getDontFlushFromFind();
  +   }
  +
  +   public Map getEnabledFilters()
  +   {
  +      return getDelegateSessionImplementor().getEnabledFilters();
  +   }
  +
  +   public EntityPersister getEntityPersister(String arg0, Object arg1) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().getEntityPersister(arg0, arg1);
  +   }
  +
  +   public Object getEntityUsingInterceptor(EntityKey arg0) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().getEntityUsingInterceptor(arg0);
  +   }
  +
  +   public SessionFactoryImplementor getFactory()
  +   {
  +      return getDelegateSessionImplementor().getFactory();
  +   }
  +
  +   public String getFetchProfile()
  +   {
  +      return getDelegateSessionImplementor().getFetchProfile();
  +   }
  +
  +   public Type getFilterParameterType(String arg0)
  +   {
  +      return getDelegateSessionImplementor().getFilterParameterType(arg0);
  +   }
  +
  +   public Object getFilterParameterValue(String arg0)
  +   {
  +      return getDelegateSessionImplementor().getFilterParameterValue(arg0);
  +   }
  +
  +   public Interceptor getInterceptor()
  +   {
  +      return getDelegateSessionImplementor().getInterceptor();
  +   }
  +
  +   public JDBCContext getJDBCContext()
  +   {
  +      return getDelegateSessionImplementor().getJDBCContext();
  +   }
  +
  +   public EventListeners getListeners()
  +   {
  +      return getDelegateSessionImplementor().getListeners();
  +   }
  +
  +   public Query getNamedSQLQuery(String arg0)
  +   {
  +      return getDelegateSessionImplementor().getNamedSQLQuery(arg0);
  +   }
  +
  +   public PersistenceContext getPersistenceContext()
  +   {
  +      return getDelegateSessionImplementor().getPersistenceContext();
  +   }
  +
  +   public long getTimestamp()
  +   {
  +      return getDelegateSessionImplementor().getTimestamp();
  +   }
  +
  +   public String guessEntityName(Object arg0) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().guessEntityName(arg0);
  +   }
  +
  +   public Object immediateLoad(String arg0, Serializable arg1) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().immediateLoad(arg0, arg1);
  +   }
  +
  +   public void initializeCollection(PersistentCollection arg0, boolean arg1) throws HibernateException
  +   {
  +      getDelegateSessionImplementor().initializeCollection(arg0, arg1);
  +   }
  +
  +   public Object instantiate(String arg0, Serializable arg1) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().instantiate(arg0, arg1);
  +   }
  +
  +   public Object internalLoad(String arg0, Serializable arg1, boolean arg2, boolean arg3) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().internalLoad(arg0, arg1, arg2, arg3);
  +   }
  +
  +   public boolean isClosed()
  +   {
  +      return getDelegateSessionImplementor().isClosed();
  +   }
  +
  +   public boolean isEventSource()
  +   {
  +      return getDelegateSessionImplementor().isEventSource();
  +   }
  +
  +   public boolean isTransactionInProgress()
  +   {
  +      return getDelegateSessionImplementor().isTransactionInProgress();
  +   }
  +
  +   public Iterator iterate(String arg0, QueryParameters arg1) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().iterate(arg0, arg1);
  +   }
  +
  +   public Iterator iterateFilter(Object arg0, String arg1, QueryParameters arg2) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().iterateFilter(arg0, arg1, arg2);
  +   }
  +
  +   public List list(CriteriaImpl arg0)
  +   {
  +      return getDelegateSessionImplementor().list(arg0);
  +   }
  +
  +   public List list(NativeSQLQuerySpecification arg0, QueryParameters arg1) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().list(arg0, arg1);
  +   }
  +
  +   public List list(String arg0, QueryParameters arg1) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().list(arg0, arg1);
  +   }
  +
  +   public List listCustomQuery(CustomQuery arg0, QueryParameters arg1) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().listCustomQuery(arg0, arg1);
  +   }
  +
  +   public List listFilter(Object arg0, String arg1, QueryParameters arg2) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().listFilter(arg0, arg1, arg2);
  +   }
  +
  +   public ScrollableResults scroll(CriteriaImpl arg0, ScrollMode arg1)
  +   {
  +      return getDelegateSessionImplementor().scroll(arg0, arg1);
  +   }
  +
  +   public ScrollableResults scroll(NativeSQLQuerySpecification arg0, QueryParameters arg1) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().scroll(arg0, arg1);
  +   }
  +
  +   public ScrollableResults scroll(String arg0, QueryParameters arg1) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().scroll(arg0, arg1);
  +   }
  +
  +   public ScrollableResults scrollCustomQuery(CustomQuery arg0, QueryParameters arg1) throws HibernateException
  +   {
  +      return getDelegateSessionImplementor().scrollCustomQuery(arg0, arg1);
  +   }
  +
  +   public void setAutoClear(boolean arg0)
  +   {
  +      getDelegateSessionImplementor().setAutoClear(arg0);
  +   }
  +
  +   public void setFetchProfile(String arg0)
  +   {
  +      getDelegateSessionImplementor().setFetchProfile(arg0);
  +   }
  +   
   }
  
  
  



More information about the jboss-cvs-commits mailing list