|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ujoframework.orm.OrmHandler
public class OrmHandler
The basic class for an ORM support.
| Constructor Summary | |
|---|---|
OrmHandler()
The constructor |
|
OrmHandler(java.lang.Class<UJO>... databaseModels)
The constructor with a database metamodel initialization. |
|
OrmHandler(java.lang.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 ORM configuration include parameters (if the parameters are not null). |
|
boolean |
config(java.lang.String url)
Load parameters from an external XML file. |
|
boolean |
config(java.net.URL url,
boolean throwsException)
Load parameters from an external XML file. |
|
Session |
createSession()
Create new session |
|
MetaRelation2Many |
findColumnModel(UjoProperty pathProperty)
Find a Relation/Column model of the paramemeter property. |
|
MetaProcedure |
findProcedureModel(java.lang.Class<? extends DbProcedure> procedureClass)
Find a procedure model by the procedureClass. |
|
java.util.List<UjoProperty> |
findPropertiesByType(java.lang.Class type)
Find all persistent properties with the required type or subtype. |
|
MetaTable |
findTableModel(java.lang.Class<? extends OrmUjo> dbClass)
Find a table model by the dbClass. |
|
java.lang.String |
getConfig()
Returns a final meta-model in the XML format |
|
java.util.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(UjoProperty property)
Is the parameter a persistent property? |
|
boolean |
isReadOnly()
Do the handler have a read-only state? |
|
|
loadDatabase(java.lang.Class<UJO>... databaseModel)
Load a meta-data and create database tables |
|
|
loadDatabase(java.lang.Class<UJO> databaseModel)
Load a meta-data 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(java.lang.Class<UJO> databaseModel)
public OrmHandler(java.lang.Class<UJO>... databaseModels)
| Method Detail |
|---|
public static OrmHandler getInstance()
public Session getSession()
createSession() rather.
createSession()public Session createSession()
public boolean config(java.lang.String url)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void config(MetaParams params)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void config(MetaRoot config)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public boolean config(java.net.URL url,
boolean throwsException)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic boolean isPersistent(UjoProperty property)
public final <UJO extends OrmUjo> void loadDatabase(java.lang.Class<UJO> databaseModel)
public <UJO extends OrmUjo> void loadDatabase(java.lang.Class<UJO>... databaseModel)
public boolean isReadOnly()
public void addProcedureModel(MetaProcedure metaProcedure)
public void addTableModel(MetaTable metaTable)
public void addColumnModel(MetaRelation2Many column)
public MetaRelation2Many findColumnModel(UjoProperty pathProperty)
pathProperty - Parameter can be type of Property of PathProperty (direct or indirect);
public MetaTable findTableModel(java.lang.Class<? extends OrmUjo> dbClass)
throws java.lang.IllegalStateException
java.lang.IllegalStateException
public MetaProcedure findProcedureModel(java.lang.Class<? extends DbProcedure> procedureClass)
throws java.lang.IllegalStateException
java.lang.IllegalStateExceptionpublic MetaParams getParameters()
public boolean isDatabaseLoaded()
public java.util.List<MetaDatabase> getDatabases()
public java.util.List<UjoProperty> findPropertiesByType(java.lang.Class type)
type - The parameter value Object.clas returns all persistent properties.public java.lang.String getConfig()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||