-
- All Known Implementing Classes:
EntityFactoryImpl
public interface EntityFactoryA factory for entity models.- Author:
- harald
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AttributecreateAttribute(Entity entity, SourceInfo sourceInfo, boolean implicit)Creates an attribute.AttributeOptionscreateAttributeOptions(Attribute attribute, SourceInfo sourceInfo)Creates attribute options.EntitycreateEntity(java.lang.String model, ModelDefaults modelDefaults)Creates an entity from a model source.EntitycreateEntity(SourceInfo sourceInfo)Creates an empty entity.EntityOptionscreateEntityOptions(Entity entity, SourceInfo sourceInfo)Creates entity options.IndexcreateIndex(Entity entity, SourceInfo sourceInfo)Creates an index.IndexAttributecreateIndexAttribute(Index index)Creates an index attribute.RelationcreateRelation(Entity entity, SourceInfo sourceInfo)Creates a relation.java.util.Collection<org.tentackle.sql.Backend>getBackends()Gets the backends to validate the model against.voidsetBackends(java.util.Collection<org.tentackle.sql.Backend> backends)Sets the backends to validate the model against.
-
-
-
Method Detail
-
setBackends
void setBackends(java.util.Collection<org.tentackle.sql.Backend> backends)
Sets the backends to validate the model against.- Parameters:
backends- the backends, null to disable check
-
getBackends
java.util.Collection<org.tentackle.sql.Backend> getBackends()
Gets the backends to validate the model against.- Returns:
- the backends, empty if check is disabled, never null
-
createEntity
Entity createEntity(SourceInfo sourceInfo)
Creates an empty entity.- Parameters:
sourceInfo- source information, null if none- Returns:
- the created entity
-
createEntity
Entity createEntity(java.lang.String model, ModelDefaults modelDefaults) throws ModelException
Creates an entity from a model source.- Parameters:
model- the model sourcemodelDefaults- the model defaults, null if none- Returns:
- the created entity
- Throws:
ModelException- if parsing the model failed
-
createAttribute
Attribute createAttribute(Entity entity, SourceInfo sourceInfo, boolean implicit)
Creates an attribute.- Parameters:
entity- the entity this attribute belongs tosourceInfo- source information, null if noneimplicit- true if implicit attribute- Returns:
- the created attribute
-
createAttributeOptions
AttributeOptions createAttributeOptions(Attribute attribute, SourceInfo sourceInfo)
Creates attribute options.- Parameters:
attribute- the attributesourceInfo- source information, null if none- Returns:
- the created options
-
createEntityOptions
EntityOptions createEntityOptions(Entity entity, SourceInfo sourceInfo)
Creates entity options.- Parameters:
entity- the entitysourceInfo- source information, null if none- Returns:
- the created options
-
createIndex
Index createIndex(Entity entity, SourceInfo sourceInfo)
Creates an index.- Parameters:
entity- the entity this index belongs tosourceInfo- source information, null if none- Returns:
- the created index
-
createIndexAttribute
IndexAttribute createIndexAttribute(Index index)
Creates an index attribute.- Parameters:
index- the index- Returns:
- the created index attribute
-
createRelation
Relation createRelation(Entity entity, SourceInfo sourceInfo)
Creates a relation.- Parameters:
entity- the entity this relation belongs tosourceInfo- source information, null if none- Returns:
- the created relation
-
-