Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.jpa
Class TypeCheckingEntityManager

    java.lang.Object
      org.apache.cayenne.jpa.TypeCheckingEntityManager

All Implemented Interfaces:
  javax.persistence.EntityManager, CayenneEntityManager

    public class TypeCheckingEntityManager

extends Object
implements CayenneEntityManager

An EntityManager decorator that checks that only properly enhanced entities are passwed to the underlying EntityManager.

Author:
  Andrus Adamchik

Field Summary
`protected CayenneEntityManager` | `entityManager`

Constructor Summary
`TypeCheckingEntityManager(CayenneEntityManager entityManager)`

Method Summary
`protected void` | `checkEntityType(Class entityClass)`
`protected void` | `checkEntityType(Object entity)`
`void` | `clear()`
`void` | `close()`
`boolean` | `contains(Object entity)`
`javax.persistence.Query` | `createNamedQuery(String name)`
`javax.persistence.Query` | `createNativeQuery(String sqlString)`
`javax.persistence.Query` | `createNativeQuery(String sqlString, Class resultClass)`
`javax.persistence.Query` | `createNativeQuery(String sqlString, String resultSetMapping)`
`javax.persistence.Query` | `createQuery(String ejbqlString)`
`protected void` | `enhance(Class entityClass)`
`
`<T> T`
` | `find(Class<T> entityClass, Object primaryKey)`
`void` | `flush()`
`DataChannel` | `getChannel()` Returns a Cayenne `DataChannel` that is used to link EntityManager with Cayenne runtime.
`Object` | `getDelegate()`
`javax.persistence.FlushModeType` | `getFlushMode()`
`
`<T> T`
` | `getReference(Class<T> entityClass, Object primaryKey)`
`javax.persistence.EntityTransaction` | `getTransaction()`
`boolean` | `isOpen()`
`void` | `joinTransaction()`
`void` | `lock(Object entity, javax.persistence.LockModeType lockMode)`
`
`<T> T`
` | `merge(T entity)`
`void` | `persist(Object entity)`
`void` | `refresh(Object entity)`
`void` | `remove(Object entity)`
`void` | `setFlushMode(javax.persistence.FlushModeType flushMode)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### entityManager

    protected CayenneEntityManager entityManager

Constructor Detail

### TypeCheckingEntityManager

    public TypeCheckingEntityManager(CayenneEntityManager entityManager)

Method Detail

### checkEntityType

    protected void checkEntityType(Class entityClass)
                            throws IllegalArgumentException

  Throws:
    `IllegalArgumentException`

### checkEntityType

    protected void checkEntityType(Object entity)
                            throws IllegalArgumentException

  Throws:
    `IllegalArgumentException`

### enhance

    protected void enhance(Class entityClass)

### clear

    public void clear()

  Specified by:
    `clear` in interface `javax.persistence.EntityManager`

### close

    public void close()

  Specified by:
    `close` in interface `javax.persistence.EntityManager`

### contains

    public boolean contains(Object entity)

  Specified by:
    `contains` in interface `javax.persistence.EntityManager`

### createNamedQuery

    public javax.persistence.Query createNamedQuery(String name)

  Specified by:
    `createNamedQuery` in interface `javax.persistence.EntityManager`

### createNativeQuery

    public javax.persistence.Query createNativeQuery(String sqlString,
                                                     Class resultClass)

  Specified by:
    `createNativeQuery` in interface `javax.persistence.EntityManager`

### createNativeQuery

    public javax.persistence.Query createNativeQuery(String sqlString,
                                                     String resultSetMapping)

  Specified by:
    `createNativeQuery` in interface `javax.persistence.EntityManager`

### createNativeQuery

    public javax.persistence.Query createNativeQuery(String sqlString)

  Specified by:
    `createNativeQuery` in interface `javax.persistence.EntityManager`

### createQuery

    public javax.persistence.Query createQuery(String ejbqlString)

  Specified by:
    `createQuery` in interface `javax.persistence.EntityManager`

### find

    public <T> T find(Class<T> entityClass,
                      Object primaryKey)

  Specified by:
    `find` in interface `javax.persistence.EntityManager`

### flush

    public void flush()

  Specified by:
    `flush` in interface `javax.persistence.EntityManager`

### getChannel

    public DataChannel getChannel()

  Description copied from interface: `CayenneEntityManager`
  Returns a Cayenne `DataChannel` that is used to link EntityManager with Cayenne runtime. DataChannel can be used for instance to obtain Cayenne metadata or add listeners.

  Specified by:
    `getChannel` in interface `CayenneEntityManager`

### getDelegate

    public Object getDelegate()

  Specified by:
    `getDelegate` in interface `javax.persistence.EntityManager`

### getFlushMode

    public javax.persistence.FlushModeType getFlushMode()

  Specified by:
    `getFlushMode` in interface `javax.persistence.EntityManager`

### getReference

    public <T> T getReference(Class<T> entityClass,
                              Object primaryKey)

  Specified by:
    `getReference` in interface `javax.persistence.EntityManager`

### getTransaction

    public javax.persistence.EntityTransaction getTransaction()

  Specified by:
    `getTransaction` in interface `javax.persistence.EntityManager`

### isOpen

    public boolean isOpen()

  Specified by:
    `isOpen` in interface `javax.persistence.EntityManager`

### joinTransaction

    public void joinTransaction()

  Specified by:
    `joinTransaction` in interface `javax.persistence.EntityManager`

### lock

    public void lock(Object entity,
                     javax.persistence.LockModeType lockMode)

  Specified by:
    `lock` in interface `javax.persistence.EntityManager`

### merge

    public <T> T merge(T entity)

  Specified by:
    `merge` in interface `javax.persistence.EntityManager`

### persist

    public void persist(Object entity)

  Specified by:
    `persist` in interface `javax.persistence.EntityManager`

### refresh

    public void refresh(Object entity)

  Specified by:
    `refresh` in interface `javax.persistence.EntityManager`

### remove

    public void remove(Object entity)

  Specified by:
    `remove` in interface `javax.persistence.EntityManager`

### setFlushMode

    public void setFlushMode(javax.persistence.FlushModeType flushMode)

  Specified by:
    `setFlushMode` in interface `javax.persistence.EntityManager`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2007 Apache Cayenne. All Rights Reserved.