|
SRJRCFrames v0.1.296 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface EntityManager
is a manger to handle retrieval, saving and removal of entities to/from persistence.
The EntityManager is not intended for direct application usage. Use
ApplicationTransactions, which will use internal Repository.
An EntityManager get's injected into repository by application-context.
Each EntityManager is related to a Class it works on. The
EntityManager should also be able to handle all subclasses of that
Class.
Repository| Method Summary | |
|---|---|
void |
commit(TransactionResource<?> resource)
used to persist all changes made during transaction. |
TransactionResource<?> |
createTransactionResource(Transaction t)
create an abstract handle to storage. |
void |
dumpTypeCache()
for debugging purpose only. |
void |
execute(TransactionalOperation<?> tao)
execute a single step of ApplicationTransaction |
String |
getApplicationName()
returns the name of the application |
EntityDescriptor |
getEntityDescriptor(Class<?> entityType,
TransactionResource<?> res)
accessor to description instances of entities. |
String |
getSchemaName(Class<?> entityType,
TransactionResource<?> resource)
returns the schema name, used by entities of given type and given storage |
void |
releaseTransactionResource(TransactionResource<?> resource)
free given storage handle |
void |
rollback(TransactionResource<?> handle)
discards changes of given storage handle and marks Transaction as
failed. |
void |
setEntityCache(EntityHolder eh)
sets the cache for entity instances |
void |
setEntityIntrospector(EntityIntrospector entityIntrospector)
sets the entity introspector used to fill an EntityDescriptor
with informations about entities. |
void |
setSchemaName(Class<?> entityType,
String schema,
TransactionResource<?> resource)
sets the schema name to use by instances of given entity and resource |
void |
setUserNameProvider(UserNameProvider unp)
sets the username provider used by this EntityManager |
| Method Detail |
|---|
void commit(TransactionResource<?> resource)
throws Exception
resource - - an abstract handle to storage
Exception - - depends on implementation
TransactionResource<?> createTransactionResource(Transaction t)
throws Exception
TransactionResource is a
wrapper to handle jdbc and preferences the same way.
t - - the transaction
Exception - - depends on implementationvoid dumpTypeCache()
EntityManager.
void execute(TransactionalOperation<?> tao)
throws Exception
ApplicationTransaction
tao - - the transactional operation to execute
Exception - - depends on implementationString getApplicationName()
EntityDescriptor getEntityDescriptor(Class<?> entityType,
TransactionResource<?> res)
EntityDescriptor holds all information needed by an
EntityManager to handle instances of that entity. The
EntityDescriptor may vary between different EntityManager
s.
entityType - - the class of that entityres - - the wrapped storage handle
String getSchemaName(Class<?> entityType,
TransactionResource<?> resource)
entityType - - the class of entityresource - - the wrapped storage handle
void releaseTransactionResource(TransactionResource<?> resource)
resource - - a wrapped storage handlevoid rollback(TransactionResource<?> handle)
Transaction as
failed.
handle - - a wrapped storage handlevoid setEntityCache(EntityHolder eh)
eh - - the cache handlervoid setEntityIntrospector(EntityIntrospector entityIntrospector)
EntityDescriptor
with informations about entities.
entityIntrospector - - the introspector to use
void setSchemaName(Class<?> entityType,
String schema,
TransactionResource<?> resource)
entityType - - class of entityschema - - the schema nameresource - - a wrapped storage handlevoid setUserNameProvider(UserNameProvider unp)
EntityManager
unp - - the username provider to use
|
SRJRCFrames v0.1.296 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||