public interface Model
| Modifier and Type | Method and Description |
|---|---|
void |
clearModel()
Clears the model.
|
Collection<Entity> |
getAllEntitites()
Gets all cached entities.
|
Entity |
getByClassId(int classId)
Gets the entity by its id.
|
Entity |
getByEntityName(String entityName)
Gets the entity by its name.
|
Entity |
getByFileName(String fileName)
Gets the entity by the mapfile name.
|
EntityFactory |
getEntityFactory()
Gets the entity factory singleton.
|
Collection<ForeignKey> |
getForeignKeys()
Gets all foreign keys.
|
static Model |
getInstance()
The singleton.
|
boolean |
isSchemaNameMapped()
Returns whether schema names are mapped.
|
Entity |
loadByFileName(ModelDefaults defaults,
String fileName)
Loads an entity for a given mapfile name.
Entities are cached so they are loaded and parsed only once. |
void |
loadModel(String modelDir,
ModelDefaults defaults)
Loads the whole model from the model directory if not yet done.
|
void |
refreshModel()
Refreshes the model.
Checks for changes and reloads if necessary. |
void |
setSchemaNameMapped(boolean mapSchemas)
Sets whether schema names should be mapped to the leading part of tablenames.
|
static Model getInstance()
EntityFactory getEntityFactory()
void loadModel(String modelDir, ModelDefaults defaults) throws ModelException
modelDir - the directory containing the model filesdefaults - model defaults, null if noneModelException - if the model is inconsistentvoid clearModel()
void setSchemaNameMapped(boolean mapSchemas)
mapSchemas - true if mapboolean isSchemaNameMapped()
void refreshModel()
throws ModelException
ModelException - if the model is inconsistentCollection<Entity> getAllEntitites() throws ModelException
ModelException - if the model is inconsistentEntity getByFileName(String fileName) throws ModelException
fileName - the name of the mapfileModelException - if the model is inconsistentEntity getByEntityName(String entityName) throws ModelException
entityName - the nameModelException - if the model is inconsistentEntity getByClassId(int classId) throws ModelException
classId - the class idModelException - if the model is inconsistentEntity loadByFileName(ModelDefaults defaults, String fileName) throws ModelException
defaults - the model defaultsfileName - the name of the mapfileModelException - if no such mapfile or parsing errorCollection<ForeignKey> getForeignKeys() throws ModelException
ModelException - if model is inconsistentCopyright © 2016 Krake Softwaretechnik. All rights reserved.