|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ujorm.orm.OrmHandler
public class OrmHandler
The basic class for an ORM support.
| Constructor Summary | |
|---|---|
OrmHandler()
The constructor |
|
OrmHandler(Class<UJO>... databaseModels)
The constructor with a database metamodel initialization. |
|
OrmHandler(Class<UJO> databaseModel)
The constructor with a database metamodel initialization. |
|
| Method Summary | ||
|---|---|---|
void |
addColumnModel(MetaRelation2Many column)
Map a property to the table |
|
void |
addProcedureModel(MetaProcedure metaProcedure)
Map a property to the table |
|
void |
addTableModel(MetaTable metaTable)
Map a property to the table |
|
void |
config(MetaParams params)
Save the ORM parameters. |
|
void |
config(MetaRoot config)
Save the alternative ORM configuration including parameters (if the parameters are not null). |
|
boolean |
config(String url)
Load parameters from an external XML file. |
|
boolean |
config(URL url,
boolean throwsException)
Load parameters from an external XML file. |
|
Session |
createSession()
Create new session |
|
|
findAnnotation(Key property,
Class<T> annotationClass)
Find a property annotation by the required type. |
|
MetaRelation2Many |
findColumnModel(Key pathProperty)
Find a Relation/Column model of the paramemeter property. |
|
MetaRelation2Many |
findColumnModel(Key pathProperty,
boolean throwException)
Find a Relation/Column model of the paramemeter property. |
|
MetaProcedure |
findProcedureModel(Class<? extends DbProcedure> procedureClass)
Find a procedure model by the procedureClass. |
|
List<Key> |
findPropertiesByType(Class type)
Find all persistent keys with the required type or subtype. |
|
MetaTable |
findTableModel(Class<? extends OrmUjo> dbClass)
Find a table model by the dbClass. |
|
String |
getConfig()
Returns a final meta-model in the XML format |
|
List<MetaDatabase> |
getDatabases()
Returns all database |
|
static OrmHandler |
getInstance()
A candidate to removing |
|
MetaParams |
getParameters()
Returns parameters |
|
Session |
getSession()
Get a default Session of the OrmHandler. |
|
boolean |
isDatabaseLoaded()
Returns true, if a database meta-model is loaded. |
|
boolean |
isPersistent(Key property)
Is the parameter a persistent property? |
|
boolean |
isReadOnly()
Do the handler have a read-only state? |
|
|
loadDatabase(Class<UJO>... databaseModel)
Load a meta-data, lock it and create database tables. |
|
|
loadDatabase(Class<UJO> databaseModel)
Load a meta-data, lock it and create database tables. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OrmHandler()
public OrmHandler(Class<UJO> databaseModel)
public OrmHandler(Class<UJO>... databaseModels)
| Method Detail |
|---|
public static OrmHandler getInstance()
public Session getSession()
createSession() rather.
createSession()public Session createSession()
public boolean config(String url)
throws IllegalArgumentException
IllegalArgumentException
public void config(MetaParams params)
throws IllegalArgumentException
IllegalArgumentException
public void config(MetaRoot config)
throws IllegalArgumentException
IllegalArgumentException
public boolean config(URL url,
boolean throwsException)
throws IllegalArgumentException
IllegalArgumentExceptionpublic boolean isPersistent(Key property)
public final <UJO extends OrmUjo> void loadDatabase(Class<UJO> databaseModel)
public <UJO extends OrmUjo> void loadDatabase(Class<UJO>... databaseModel)
public boolean isReadOnly()
public void addProcedureModel(MetaProcedure metaProcedure)
public void addTableModel(MetaTable metaTable)
public void addColumnModel(MetaRelation2Many column)
public <T extends Annotation> T findAnnotation(Key property,
Class<T> annotationClass)
public final MetaRelation2Many findColumnModel(Key pathProperty)
pathProperty - Parameter can be type of Property of CompositeKey (direct or indirect);
public MetaRelation2Many findColumnModel(Key pathProperty,
boolean throwException)
throws IllegalArgumentException
pathProperty - Parameter can be type of Property of CompositeKey (direct or indirect);throwException - Throw the IllegalArgument exception of no Model was not found
IllegalArgumentException
public MetaTable findTableModel(Class<? extends OrmUjo> dbClass)
throws IllegalStateException
IllegalStateException
public MetaProcedure findProcedureModel(Class<? extends DbProcedure> procedureClass)
throws IllegalStateException
IllegalStateExceptionpublic MetaParams getParameters()
public boolean isDatabaseLoaded()
public List<MetaDatabase> getDatabases()
public List<Key> findPropertiesByType(Class type)
type - The parameter value Object.clas returns all persistent keys.public String getConfig()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||