| java.lang.Object |
| ↳ |
org.mule.module.jpa.JPAModule |
Known Direct Subclasses
|
Known Indirect Subclasses
|
Class Overview
Java Persistence API (JPA) support for Mule.
Summary
| Public Methods |
|
void
|
connect()
|
|
Object
|
detach(Object entity, Boolean flush)
Detaches the message's payload from the session.
|
|
Object
|
find(String entityClass, Object id, Boolean flush)
Looks up an entity using the message's payload as the primary key.
|
|
EntityManagerFactory
|
getEntityManagerFactory()
|
|
Object
|
merge(Object entity, Boolean flush)
Merges the payload of the message.
|
|
Object
|
persist(Object entity, Boolean flush)
Persists the payload of the message.
|
|
Object
|
query(CriteriaQuery criteria, String statement, String namedQuery, Object queryParameters, Boolean flush)
Execute a JPA query.
|
|
void
|
setEntityManagerFactory(EntityManagerFactory entityManagerFactory)
|
|
void
|
setMuleContext(MuleContext muleContext)
|
|
Object
|
upsert(Object entity, Object id, String fields, boolean flush)
|
|
[Expand]
Inherited Methods |
From class
java.lang.Object
|
Object
|
clone()
|
|
boolean
|
equals(Object arg0)
|
|
void
|
finalize()
|
|
final
Class<?>
|
getClass()
|
|
int
|
hashCode()
|
|
final
void
|
notify()
|
|
final
void
|
notifyAll()
|
|
String
|
toString()
|
|
final
void
|
wait()
|
|
final
void
|
wait(long arg0, int arg1)
|
|
final
void
|
wait(long arg0)
|
|
From interface
org.mule.api.context.MuleContextAware
|
abstract
void
|
setMuleContext(MuleContext arg0)
|
|
Fields
EntityManagerFactory
entityManagerFactory
Reference to an EntityManagerFactory
Public Constructors
Public Methods
public
Object
detach
(Object entity, Boolean flush)
Detaches the message's payload from the session.
Parameters
| entity
| The entity to detach. |
| flush
| Flush the session if true |
Throws
| Exception
| An exception when there's an error
|
public
Object
find
(String entityClass, Object id, Boolean flush)
Looks up an entity using the message's payload as the primary key.
Parameters
| entityClass
| The class of the entity to find. |
| id
| The ID of the entity to find. |
| flush
| Flush the session if true |
Returns
- The entity or null if it isn't found.
Throws
| Exception
| An exception when there's an error
|
public
EntityManagerFactory
getEntityManagerFactory
()
public
Object
merge
(Object entity, Boolean flush)
Merges the payload of the message.
Parameters
| entity
| The entity to persist. |
| flush
| Flush the session if true |
Throws
| Exception
| An exception when there's an error
|
public
Object
persist
(Object entity, Boolean flush)
Persists the payload of the message.
Parameters
| entity
| The entity to persist. |
| flush
| Flush the session if true |
Throws
| Exception
| An exception when there's an error
|
public
Object
query
(CriteriaQuery criteria, String statement, String namedQuery, Object queryParameters, Boolean flush)
Execute a JPA query. If the payload of the message is a List or Map then its used
as the query parameters. If neither statement nor namedQuery are set then the payload of the message is assumed
to be a CriteriaQuery instance.
Parameters
| criteria
| The CriteriaQuery |
| statement
| A JPA QL statement to execute |
| namedQuery
| A named query to execute |
| queryParameters
| The query parameters |
| flush
| Flush the session if true |
Throws
| Exception
| An exception when there's an error
|
public
void
setEntityManagerFactory
(EntityManagerFactory entityManagerFactory)
public
void
setMuleContext
(MuleContext muleContext)
public
Object
upsert
(Object entity, Object id, String fields, boolean flush)
Parameters
| entity
| The entity to upsert. |
| id
| The id of the object to lookup |
| fields
| The fields to update |
| flush
| Flush the sesssion if true |
Throws
| Exception
| An exception when there's an error.
|