001: package org.vraptor.plugin.jpa;
002:
003: import javax.persistence.*;
004:
005: /**
006: * Created by IntelliJ IDEA.
007: * User: fck
008: * Date: Feb 28, 2007
009: * Time: 2:33:40 PM
010: */
011: class VRaptorEntityManager implements EntityManager {
012:
013: private EntityManager original;
014:
015: public VRaptorEntityManager(EntityManager original) {
016: this .original = original;
017: }
018:
019: public void joinTransaction() {
020: throw new UnsupportedOperationException(
021: "Only valid in a JTA environment.");
022: }
023:
024: public void close() {
025: throw new UnsupportedOperationException(
026: "VRaptor will handle the lifecycle for you.");
027: }
028:
029: public Object getDelegate() {
030: return original.getDelegate();
031: }
032:
033: public void persist(Object o) {
034: original.persist(o);
035: }
036:
037: public <T> T merge(T t) {
038: return original.merge(t);
039: }
040:
041: public void remove(Object o) {
042: original.remove(o);
043: }
044:
045: public <T> T find(Class<T> aClass, Object o) {
046: return original.find(aClass, o);
047: }
048:
049: public <T> T getReference(Class<T> aClass, Object o) {
050: return original.getReference(aClass, o);
051: }
052:
053: public void flush() {
054: original.flush();
055: }
056:
057: public void setFlushMode(FlushModeType flushModeType) {
058: original.setFlushMode(flushModeType);
059: }
060:
061: public FlushModeType getFlushMode() {
062: return original.getFlushMode();
063: }
064:
065: public void lock(Object o, LockModeType lockModeType) {
066: original.lock(o, lockModeType);
067: }
068:
069: public void refresh(Object o) {
070: original.refresh(o);
071: }
072:
073: public void clear() {
074: original.clear();
075: }
076:
077: public boolean contains(Object o) {
078: return original.contains(o);
079: }
080:
081: public Query createQuery(String s) {
082: return original.createQuery(s);
083: }
084:
085: public Query createNamedQuery(String s) {
086: return original.createNamedQuery(s);
087: }
088:
089: public Query createNativeQuery(String s) {
090: return original.createNativeQuery(s);
091: }
092:
093: public Query createNativeQuery(String s, Class aClass) {
094: return original.createNativeQuery(s, aClass);
095: }
096:
097: public Query createNativeQuery(String s, String s1) {
098: return original.createNativeQuery(s, s1);
099: }
100:
101: public boolean isOpen() {
102: return original.isOpen();
103: }
104:
105: public EntityTransaction getTransaction() {
106: return original.getTransaction();
107: }
108: }
|