[seam-commits] Seam SVN: r9696 - trunk/src/main/org/jboss/seam/persistence.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Tue Dec 2 07:05:50 EST 2008
Author: shane.bryzak at jboss.com
Date: 2008-12-02 07:05:50 -0500 (Tue, 02 Dec 2008)
New Revision: 9696
Modified:
trunk/src/main/org/jboss/seam/persistence/AbstractPersistenceProvider.java
trunk/src/main/org/jboss/seam/persistence/EntityManagerProxy.java
trunk/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java
trunk/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java
trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
trunk/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java
trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java
Log:
looks like i broke a few things.. reverting for now
Modified: trunk/src/main/org/jboss/seam/persistence/AbstractPersistenceProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/AbstractPersistenceProvider.java 2008-12-02 09:43:58 UTC (rev 9695)
+++ trunk/src/main/org/jboss/seam/persistence/AbstractPersistenceProvider.java 2008-12-02 12:05:50 UTC (rev 9696)
@@ -1,7 +1,6 @@
package org.jboss.seam.persistence;
import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
import java.util.Date;
import javax.persistence.EntityManager;
@@ -110,10 +109,8 @@
* Wrap the entityManager before returning it to the application
*/
public EntityManager proxyEntityManager(EntityManager entityManager)
- {
- return (EntityManager) Proxy.newProxyInstance(EntityManager.class.getClassLoader(),
- new Class[] {EntityManager.class},
- new EntityManagerProxy(entityManager));
+ {
+ return new EntityManagerProxy(entityManager);
}
/**
Modified: trunk/src/main/org/jboss/seam/persistence/EntityManagerProxy.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/EntityManagerProxy.java 2008-12-02 09:43:58 UTC (rev 9695)
+++ trunk/src/main/org/jboss/seam/persistence/EntityManagerProxy.java 2008-12-02 12:05:50 UTC (rev 9696)
@@ -3,30 +3,70 @@
import java.io.Serializable;
import javax.persistence.EntityManager;
+import javax.persistence.EntityTransaction;
+import javax.persistence.FlushModeType;
+import javax.persistence.LockModeType;
import javax.persistence.Query;
import org.jboss.seam.security.permission.PermissionManager;
-import org.jboss.seam.util.DelegatingInvocationHandler;
/**
- * Proxies the EntityManager, and implements EL interpolation in JPA-QL
+ * Proxies the EntityManager, and implements EL interpolation
+ * in JPA-QL
*
* @author Gavin King
- * @author Shane Bryzak
+ *
*/
-public class EntityManagerProxy extends DelegatingInvocationHandler<EntityManager> implements Serializable
+public class EntityManagerProxy implements EntityManager, Serializable
{
+ private EntityManager delegate;
+
public EntityManagerProxy(EntityManager entityManager)
{
- super(entityManager);
+ delegate = entityManager;
}
+ public void clear()
+ {
+ delegate.clear();
+ }
+
+ public void close()
+ {
+ delegate.close();
+ }
+
+ public boolean contains(Object entity)
+ {
+ return delegate.contains(entity);
+ }
+
+ public Query createNamedQuery(String name)
+ {
+ return delegate.createNamedQuery(name);
+ }
+
+ public Query createNativeQuery(String sql, Class clazz)
+ {
+ return delegate.createNativeQuery(sql, clazz);
+ }
+
+ public Query createNativeQuery(String sql, String lang)
+ {
+ return delegate.createNativeQuery(sql, lang);
+ }
+
+ public Query createNativeQuery(String sql)
+ {
+ return delegate.createNativeQuery(sql);
+ }
+
public Query createQuery(String ejbql)
{
if ( ejbql.indexOf('#')>0 )
{
QueryParser qp = new QueryParser(ejbql);
- Query query = super.getDelegate().createQuery( qp.getEjbql() );
+ Query query = delegate.createQuery( qp.getEjbql() );
for (int i=0; i<qp.getParameterValueBindings().size(); i++)
{
query.setParameter(
@@ -38,19 +78,78 @@
}
else
{
- return super.getDelegate().createQuery(ejbql);
+ return delegate.createQuery(ejbql);
}
}
- /* public Object getDelegate()
+ public <T> T find(Class<T> clazz, Object id)
{
- return PersistenceProvider.instance().proxyDelegate( super.getDelegate().getDelegate() );
- }*/
+ return delegate.find(clazz, id);
+ }
+ public void flush()
+ {
+ delegate.flush();
+ }
+ public Object getDelegate()
+ {
+ return PersistenceProvider.instance().proxyDelegate( delegate.getDelegate() );
+ }
+
+ public FlushModeType getFlushMode()
+ {
+ return delegate.getFlushMode();
+ }
+
+ public <T> T getReference(Class<T> clazz, Object id)
+ {
+ return delegate.getReference(clazz, id);
+ }
+
+ public EntityTransaction getTransaction()
+ {
+ return delegate.getTransaction();
+ }
+
+ public boolean isOpen()
+ {
+ return delegate.isOpen();
+ }
+
+ public void joinTransaction()
+ {
+ delegate.joinTransaction();
+ }
+
+ public void lock(Object entity, LockModeType lm)
+ {
+ delegate.lock(entity, lm);
+ }
+
+ public <T> T merge(T entity)
+ {
+ return delegate.merge(entity);
+ }
+
+ public void persist(Object entity)
+ {
+ delegate.persist(entity);
+ }
+
+ public void refresh(Object entity)
+ {
+ delegate.refresh(entity);
+ }
+
public void remove(Object entity)
{
- super.getDelegate().remove(entity);
+ delegate.remove(entity);
PermissionManager.instance().clearPermissions(entity);
}
+
+ public void setFlushMode(FlushModeType fm)
+ {
+ delegate.setFlushMode(fm);
+ }
}
Modified: trunk/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java 2008-12-02 09:43:58 UTC (rev 9695)
+++ trunk/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java 2008-12-02 12:05:50 UTC (rev 9696)
@@ -1,19 +1,50 @@
//$Id$
package org.jboss.seam.persistence;
+import java.io.Serializable;
+
+import org.apache.lucene.search.Query;
+import org.hibernate.search.SearchFactory;
import org.hibernate.search.jpa.FullTextEntityManager;
-import org.jboss.seam.util.DelegatingInvocationHandler;
+import org.hibernate.search.jpa.FullTextQuery;
/**
* Wrap a FullTextEntityManager
*
* @author Emmanuel Bernard
- * @author Shane Bryzak
*/
-public class FullTextEntityManagerProxy extends DelegatingInvocationHandler<FullTextEntityManager>
+public class FullTextEntityManagerProxy extends EntityManagerProxy implements FullTextEntityManager
{
+ private FullTextEntityManager fullTextEntityManager;
+
public FullTextEntityManagerProxy(FullTextEntityManager entityManager)
{
super(entityManager);
+ this.fullTextEntityManager = entityManager;
}
+
+ public FullTextQuery createFullTextQuery(Query query, Class... classes)
+ {
+ return fullTextEntityManager.createFullTextQuery(query, classes);
+ }
+
+ public void index(Object object)
+ {
+ fullTextEntityManager.index(object);
+ }
+
+ public SearchFactory getSearchFactory()
+ {
+ return fullTextEntityManager.getSearchFactory();
+ }
+
+ public void purge(Class aClass, Serializable serializable)
+ {
+ fullTextEntityManager.purge(aClass, serializable);
+ }
+
+ public void purgeAll(Class aClass)
+ {
+ fullTextEntityManager.purgeAll(aClass);
+ }
}
Modified: trunk/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java 2008-12-02 09:43:58 UTC (rev 9695)
+++ trunk/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java 2008-12-02 12:05:50 UTC (rev 9696)
@@ -1,20 +1,168 @@
package org.jboss.seam.persistence;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.hibernate.HibernateException;
+import org.hibernate.Query;
+import org.hibernate.search.FullTextQuery;
import org.hibernate.search.FullTextSession;
-import org.jboss.seam.util.DelegatingInvocationHandler;
+import org.hibernate.search.SearchFactory;
+import org.hibernate.type.Type;
/**
* Wraps a Hibernate Search session
*
* @author Gavin King
- * @author Shane Bryzak
*
*/
@SuppressWarnings("deprecation")
-public class FullTextHibernateSessionProxy extends DelegatingInvocationHandler<FullTextSession>
-{
+public class FullTextHibernateSessionProxy extends HibernateSessionProxy implements FullTextSession
+{
+ private FullTextSession fullTextSession;
+
public FullTextHibernateSessionProxy(FullTextSession fullTextSession)
{
super(fullTextSession);
+ this.fullTextSession = fullTextSession;
}
+
+ public void index(Object arg0)
+ {
+ fullTextSession.index(arg0);
+ }
+
+ public FullTextQuery createFullTextQuery(org.apache.lucene.search.Query arg0, Class... arg1)
+ {
+ return fullTextSession.createFullTextQuery(arg0, arg1);
+ }
+
+ public Query createSQLQuery(String arg0, String arg1, Class arg2)
+ {
+ return fullTextSession.createSQLQuery(arg0, arg1, arg2);
+ }
+
+ public Query createSQLQuery(String arg0, String[] arg1, Class[] arg2)
+ {
+ return fullTextSession.createSQLQuery(arg0, arg1, arg2);
+ }
+
+ public int delete(String arg0, Object arg1, Type arg2) throws HibernateException
+ {
+ return fullTextSession.delete(arg0, arg1, arg2);
+ }
+
+ public int delete(String arg0, Object[] arg1, Type[] arg2) throws HibernateException
+ {
+ return fullTextSession.delete(arg0, arg1, arg2);
+ }
+
+ public int delete(String arg0) throws HibernateException
+ {
+ return fullTextSession.delete(arg0);
+ }
+
+ public Collection filter(Object arg0, String arg1, Object arg2, Type arg3) throws HibernateException
+ {
+ return fullTextSession.filter(arg0, arg1, arg2, arg3);
+ }
+
+ public Collection filter(Object arg0, String arg1, Object[] arg2, Type[] arg3) throws HibernateException
+ {
+ return fullTextSession.filter(arg0, arg1, arg2, arg3);
+ }
+
+ public Collection filter(Object arg0, String arg1) throws HibernateException
+ {
+ return fullTextSession.filter(arg0, arg1);
+ }
+
+ public List find(String arg0, Object arg1, Type arg2) throws HibernateException
+ {
+ return fullTextSession.find(arg0, arg1, arg2);
+ }
+
+ public List find(String arg0, Object[] arg1, Type[] arg2) throws HibernateException
+ {
+ return fullTextSession.find(arg0, arg1, arg2);
+ }
+
+ public List find(String arg0) throws HibernateException
+ {
+ return fullTextSession.find(arg0);
+ }
+
+
+ public SearchFactory getSearchFactory()
+ {
+ return fullTextSession.getSearchFactory();
+ }
+
+ public void purge(Class aClass, Serializable serializable)
+ {
+ fullTextSession.purge(aClass, serializable);
+ }
+
+ public void purgeAll(Class aClass)
+ {
+ fullTextSession.purgeAll(aClass);
+ }
+
+ public Iterator iterate(String arg0, Object arg1, Type arg2) throws HibernateException
+ {
+ return fullTextSession.iterate(arg0, arg1, arg2);
+ }
+
+ public Iterator iterate(String arg0, Object[] arg1, Type[] arg2) throws HibernateException
+ {
+ return fullTextSession.iterate(arg0, arg1, arg2);
+ }
+
+ public Iterator iterate(String arg0) throws HibernateException
+ {
+ return fullTextSession.iterate(arg0);
+ }
+
+ public void save(Object arg0, Serializable arg1) throws HibernateException
+ {
+ fullTextSession.save(arg0, arg1);
+ }
+
+ public void save(String arg0, Object arg1, Serializable arg2) throws HibernateException
+ {
+ fullTextSession.save(arg0, arg1, arg2);
+ }
+
+ public Object saveOrUpdateCopy(Object arg0, Serializable arg1) throws HibernateException
+ {
+ return fullTextSession.saveOrUpdateCopy(arg0, arg1);
+ }
+
+ public Object saveOrUpdateCopy(Object arg0) throws HibernateException
+ {
+ return fullTextSession.saveOrUpdateCopy(arg0);
+ }
+
+ public Object saveOrUpdateCopy(String arg0, Object arg1, Serializable arg2) throws HibernateException
+ {
+ return fullTextSession.saveOrUpdateCopy(arg0, arg1, arg2);
+ }
+
+ public Object saveOrUpdateCopy(String arg0, Object arg1) throws HibernateException
+ {
+ return fullTextSession.saveOrUpdateCopy(arg0, arg1);
+ }
+
+ public void update(Object arg0, Serializable arg1) throws HibernateException
+ {
+ fullTextSession.update(arg0, arg1);
+ }
+
+ public void update(String arg0, Object arg1, Serializable arg2) throws HibernateException
+ {
+ fullTextSession.update(arg0, arg1, arg2);
+ }
+
}
Modified: trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2008-12-02 09:43:58 UTC (rev 9695)
+++ trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2008-12-02 12:05:50 UTC (rev 9696)
@@ -4,7 +4,6 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
import java.util.Collection;
import java.util.Map;
@@ -17,7 +16,6 @@
import org.hibernate.Session;
import org.hibernate.StaleStateException;
import org.hibernate.TransientObjectException;
-import org.hibernate.engine.SessionImplementor;
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.type.VersionType;
@@ -95,9 +93,7 @@
{
if (FULL_TEXT_SESSION_PROXY_CONSTRUCTOR==null)
{
- return (Session) Proxy.newProxyInstance(Session.class.getClassLoader(),
- new Class[] {Session.class, SessionImplementor.class},
- new HibernateSessionProxy(session));
+ return new HibernateSessionProxy(session);
}
else
{
@@ -106,9 +102,7 @@
}
catch(Exception e) {
log.warn("Unable to wrap into a FullTextSessionProxy, regular SessionProxy returned", e);
- return (Session) Proxy.newProxyInstance(Session.class.getClassLoader(),
- new Class[] {Session.class, SessionImplementor.class},
- new HibernateSessionProxy(session));
+ return new HibernateSessionProxy(session);
}
}
}
Modified: trunk/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java 2008-12-02 09:43:58 UTC (rev 9695)
+++ trunk/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java 2008-12-02 12:05:50 UTC (rev 9696)
@@ -1,26 +1,36 @@
package org.jboss.seam.persistence;
import java.io.Serializable;
+import java.sql.Connection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import org.hibernate.CacheMode;
+import org.hibernate.Criteria;
+import org.hibernate.EntityMode;
+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.ActionQueue;
-import org.hibernate.engine.EntityEntry;
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.ActionQueue;
+import org.hibernate.engine.EntityEntry;
import org.hibernate.engine.query.sql.NativeSQLQuerySpecification;
import org.hibernate.event.EventListeners;
import org.hibernate.event.EventSource;
@@ -29,8 +39,8 @@
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;
-import org.jboss.seam.util.DelegatingInvocationHandler;
/**
* Proxies the Session, and implements EL interpolation
@@ -39,25 +49,83 @@
*
* @author Gavin King
* @author Emmanuel Bernard
- * @author Shane Bryzak
+ * FIXME: EventSource should not really be there, remove once HSearch is fixed
*
*/
-public class HibernateSessionProxy extends DelegatingInvocationHandler<Session>
-{
+public class HibernateSessionProxy implements Session, SessionImplementor, EventSource
+{
+ private Session delegate;
+
/**
* Don't use that constructor directly, use HibernatePersistenceProvider.proxySession()
*/
public HibernateSessionProxy(Session session)
{
- super(session);
- }
+ delegate = session;
+ }
+ public Transaction beginTransaction() throws HibernateException
+ {
+ return delegate.beginTransaction();
+ }
+
+ public void cancelQuery() throws HibernateException
+ {
+ delegate.cancelQuery();
+ }
+
+ public void clear()
+ {
+ delegate.clear();
+ }
+
+ public Connection close() throws HibernateException
+ {
+ return delegate.close();
+ }
+
+ @SuppressWarnings("deprecation")
+ public Connection connection() throws HibernateException
+ {
+ return delegate.connection();
+ }
+
+ public boolean contains(Object arg0)
+ {
+ return delegate.contains(arg0);
+ }
+
+ public Criteria createCriteria(Class arg0, String arg1)
+ {
+ return delegate.createCriteria(arg0, arg1);
+ }
+
+ public Criteria createCriteria(Class arg0)
+ {
+ return delegate.createCriteria(arg0);
+ }
+
+ public Criteria createCriteria(String arg0, String arg1)
+ {
+ return delegate.createCriteria(arg0, arg1);
+ }
+
+ public Criteria createCriteria(String arg0)
+ {
+ return delegate.createCriteria(arg0);
+ }
+
+ public Query createFilter(Object arg0, String arg1) throws HibernateException
+ {
+ return delegate.createFilter(arg0, arg1);
+ }
+
public Query createQuery(String hql) throws HibernateException
{
if ( hql.indexOf('#')>0 )
{
QueryParser qp = new QueryParser(hql);
- Query query = getDelegate().createQuery( qp.getEjbql() );
+ Query query = delegate.createQuery( qp.getEjbql() );
for (int i=0; i<qp.getParameterValueBindings().size(); i++)
{
query.setParameter(
@@ -69,23 +137,283 @@
}
else
{
- return getDelegate().createQuery(hql);
+ return delegate.createQuery(hql);
}
}
+ public SQLQuery createSQLQuery(String arg0) throws HibernateException
+ {
+ return delegate.createSQLQuery(arg0);
+ }
+
+ public void delete(Object arg0) throws HibernateException
+ {
+ delegate.delete(arg0);
+ }
+
+ public void delete(String arg0, Object arg1) throws HibernateException
+ {
+ delegate.delete(arg0, arg1);
+ }
+
+ public void disableFilter(String arg0)
+ {
+ delegate.disableFilter(arg0);
+ }
+
+ public Connection disconnect() throws HibernateException
+ {
+ return delegate.disconnect();
+ }
+
+ public Filter enableFilter(String arg0)
+ {
+ return delegate.enableFilter(arg0);
+ }
+
+ public void evict(Object arg0) throws HibernateException
+ {
+ delegate.evict(arg0);
+ }
+
+ public void flush() throws HibernateException
+ {
+ delegate.flush();
+ }
+
+ public Object get(Class arg0, Serializable arg1, LockMode arg2) throws HibernateException
+ {
+ return delegate.get(arg0, arg1, arg2);
+ }
+
+ public Object get(Class arg0, Serializable arg1) throws HibernateException
+ {
+ return delegate.get(arg0, arg1);
+ }
+
+ public Object get(String arg0, Serializable arg1, LockMode arg2) throws HibernateException
+ {
+ return delegate.get(arg0, arg1, arg2);
+ }
+
+ public Object get(String arg0, Serializable arg1) throws HibernateException
+ {
+ return delegate.get(arg0, arg1);
+ }
+
+ public CacheMode getCacheMode()
+ {
+ return delegate.getCacheMode();
+ }
+
+ public LockMode getCurrentLockMode(Object arg0) throws HibernateException
+ {
+ return delegate.getCurrentLockMode(arg0);
+ }
+
+ public Filter getEnabledFilter(String arg0)
+ {
+ return delegate.getEnabledFilter(arg0);
+ }
+
+ public EntityMode getEntityMode()
+ {
+ return delegate.getEntityMode();
+ }
+
+ public String getEntityName(Object arg0) throws HibernateException
+ {
+ return delegate.getEntityName(arg0);
+ }
+
+ public FlushMode getFlushMode()
+ {
+ return delegate.getFlushMode();
+ }
+
+ public Serializable getIdentifier(Object arg0) throws HibernateException
+ {
+ return delegate.getIdentifier(arg0);
+ }
+
+ public Query getNamedQuery(String arg0) throws HibernateException
+ {
+ return delegate.getNamedQuery(arg0);
+ }
+
+ public Session getSession(EntityMode arg0)
+ {
+ return delegate.getSession(arg0);
+ }
+
+ public SessionFactory getSessionFactory()
+ {
+ return delegate.getSessionFactory();
+ }
+
+ public SessionStatistics getStatistics()
+ {
+ return delegate.getStatistics();
+ }
+
+ public Transaction getTransaction()
+ {
+ return delegate.getTransaction();
+ }
+
+ public boolean isConnected()
+ {
+ return delegate.isConnected();
+ }
+
+ public boolean isDirty() throws HibernateException
+ {
+ return delegate.isDirty();
+ }
+
+ public boolean isOpen()
+ {
+ return delegate.isOpen();
+ }
+
+ public Object load(Class arg0, Serializable arg1, LockMode arg2) throws HibernateException
+ {
+ return delegate.load(arg0, arg1, arg2);
+ }
+
+ public Object load(Class arg0, Serializable arg1) throws HibernateException
+ {
+ return delegate.load(arg0, arg1);
+ }
+
+ public void load(Object arg0, Serializable arg1) throws HibernateException
+ {
+ delegate.load(arg0, arg1);
+ }
+
+ public Object load(String arg0, Serializable arg1, LockMode arg2) throws HibernateException
+ {
+ return delegate.load(arg0, arg1, arg2);
+ }
+
+ public Object load(String arg0, Serializable arg1) throws HibernateException
+ {
+ return delegate.load(arg0, arg1);
+ }
+
+ public void lock(Object arg0, LockMode arg1) throws HibernateException
+ {
+ delegate.lock(arg0, arg1);
+ }
+
+ public void lock(String arg0, Object arg1, LockMode arg2) throws HibernateException
+ {
+ delegate.lock(arg0, arg1, arg2);
+ }
+
+ public Object merge(Object arg0) throws HibernateException
+ {
+ return delegate.merge(arg0);
+ }
+
+ public Object merge(String arg0, Object arg1) throws HibernateException
+ {
+ return delegate.merge(arg0, arg1);
+ }
+
+ public void persist(Object arg0) throws HibernateException
+ {
+ delegate.persist(arg0);
+ }
+
+ public void persist(String arg0, Object arg1) throws HibernateException
+ {
+ delegate.persist(arg0, arg1);
+ }
+
public void reconnect() throws HibernateException
{
throw new UnsupportedOperationException("deprecated");
}
+
+ public void reconnect(Connection arg0) throws HibernateException
+ {
+ delegate.reconnect(arg0);
+ }
+
+ public void refresh(Object arg0, LockMode arg1) throws HibernateException
+ {
+ delegate.refresh(arg0, arg1);
+ }
+
+ public void refresh(Object arg0) throws HibernateException
+ {
+ delegate.refresh(arg0);
+ }
+
+ public void replicate(Object arg0, ReplicationMode arg1) throws HibernateException
+ {
+ delegate.replicate(arg0, arg1);
+ }
+
+ public void replicate(String arg0, Object arg1, ReplicationMode arg2) throws HibernateException
+ {
+ delegate.replicate(arg0, arg1, arg2);
+ }
+
+ public Serializable save(Object arg0) throws HibernateException
+ {
+ return delegate.save(arg0);
+ }
+
+ public Serializable save(String arg0, Object arg1) throws HibernateException
+ {
+ return delegate.save(arg0, arg1);
+ }
+
+ public void saveOrUpdate(Object arg0) throws HibernateException
+ {
+ delegate.saveOrUpdate(arg0);
+ }
+
+ public void saveOrUpdate(String arg0, Object arg1) throws HibernateException
+ {
+ delegate.saveOrUpdate(arg0, arg1);
+ }
+
+ public void setCacheMode(CacheMode arg0)
+ {
+ delegate.setCacheMode(arg0);
+ }
+
+ public void setFlushMode(FlushMode arg0)
+ {
+ delegate.setFlushMode(arg0);
+ }
+
+ public void setReadOnly(Object arg0, boolean arg1)
+ {
+ delegate.setReadOnly(arg0, arg1);
+ }
+
+ public void update(Object arg0) throws HibernateException
+ {
+ delegate.update(arg0);
+ }
+
+ public void update(String arg0, Object arg1) throws HibernateException
+ {
+ delegate.update(arg0, arg1);
+ }
private SessionImplementor getDelegateSessionImplementor()
{
- return (SessionImplementor) getDelegate();
+ return (SessionImplementor) delegate;
}
private EventSource getDelegateEventSource()
{
- return (EventSource) getDelegate();
+ return (EventSource) delegate;
}
public void afterScrollOperation()
Modified: trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java 2008-12-02 09:43:58 UTC (rev 9695)
+++ trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java 2008-12-02 12:05:50 UTC (rev 9696)
@@ -2,7 +2,6 @@
import static org.jboss.seam.annotations.Install.BUILT_IN;
import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
import java.util.Date;
import javax.persistence.EntityManager;
@@ -137,10 +136,8 @@
/**
* Wrap the entityManager before returning it to the application
*/
- public EntityManager proxyEntityManager(EntityManager entityManager) {
- return (EntityManager) Proxy.newProxyInstance(EntityManager.class.getClassLoader(),
- new Class[] {EntityManager.class},
- new EntityManagerProxy(entityManager));
+ public EntityManager proxyEntityManager(EntityManager entityManager) {
+ return new EntityManagerProxy(entityManager);
}
/**
More information about the seam-commits
mailing list