public interface TopiaPersistenceContext
| Modifier and Type | Method and Description |
|---|---|
void |
createSchema()
Triggers database schema creation
|
void |
dropSchema()
Triggers database schema drop
|
<E extends TopiaEntity> |
findByTopiaId(String topiaId)
Retrieve
TopiaEntity using its unique topiaId. |
Properties |
getConfig() |
<E extends TopiaEntity> |
getDAO(Class<E> entityClass)
Get DAO for specified class.
|
<E extends TopiaEntity,D extends TopiaDAO<E>> |
getDAO(Class<E> entityClass,
Class<D> daoClass)
Get DAO for specified class.
|
List<Class<?>> |
getPersistenceClasses() |
String |
getSchemaName() |
TopiaIdFactory |
getTopiaIdFactory()
Get the currently configured
TopiaIdFactory. |
boolean |
isSchemaEmpty()
Detects if the db associated to the current context contains at least one
entity table.
|
boolean |
isTableExists(Class<?> clazz)
Detects if the table is created on storage for a given persistent class.
|
void |
setUseFlushMode(boolean useFlushMode)
Tells to the context if it has to use a flush mode before each query.
|
void |
showCreateSchema()
Displays the SQL queries that would be used for a schema creation
|
void |
update(TopiaEntity entity)
Add into this TopiaContext an entity created by another TopiaContext
|
void |
updateSchema()
Triggers database schema update
|
<E extends TopiaEntity> E findByTopiaId(String topiaId)
TopiaEntity using its unique topiaId.topiaId - unique identifier of the entity in all the application.void update(TopiaEntity entity)
entity - the entity to addTopiaIdFactory getTopiaIdFactory()
TopiaIdFactory.TopiaIdFactory in useTopiaIdFactory}List<Class<?>> getPersistenceClasses()
void setUseFlushMode(boolean useFlushMode)
false.useFlushMode - the new value to setProperties getConfig()
<E extends TopiaEntity> TopiaDAO<E> getDAO(Class<E> entityClass)
entityClass - type of entity<E extends TopiaEntity,D extends TopiaDAO<E>> D getDAO(Class<E> entityClass, Class<D> daoClass)
entityClass - type of entitydaoClass - the concrete dao class to useboolean isSchemaEmpty()
true if there is no schema for any of the dealed entities,
false otherwise.boolean isTableExists(Class<?> clazz)
clazz - the researched classString getSchemaName()
void createSchema()
void showCreateSchema()
void updateSchema()
void dropSchema()
Copyright © 2004–2013 CodeLutin. All rights reserved.