public class PdoGenerator extends AbstractGenerator
| Constructor and Description |
|---|
PdoGenerator() |
| Modifier and Type | Method and Description |
|---|---|
List<org.tentackle.validate.ValidationResult> |
generate()
Creates the PDO files.
|
Integer |
getClassId() |
String |
getDomainImplementation() |
String |
getDomainInterface() |
String |
getEntityName() |
InheritanceType |
getInheritanceType() |
String |
getLongDescription() |
String |
getPersistenceImplementation() |
String |
getPersistenceInterface() |
PdoProfile |
getProfile() |
String |
getShortDescription() |
String |
getSuperDomainImplementation()
Gets the name of the parent domain class.
|
String |
getSuperDomainInterface()
Gets the name of the parent domain interface.
|
Entity |
getSuperEntity() |
String |
getSuperPdoInterface()
Gets the name of the parent pdo interface.
|
String |
getSuperPersistenceImplementation()
Gets the name of the parent persistence class.
|
String |
getSuperPersistenceInterface()
Gets the name of the parent persistence interface.
|
String |
getTableName() |
boolean |
isClassIdNecessary()
Checks whether entity needs a class ID.
|
boolean |
isInheritanceTypeValid() |
boolean |
isNewClassId()
Checks whether classID is not already used in model.
|
boolean |
isNewEntity()
Checks whether entity name is not already used in model.
|
boolean |
isNewTableName()
Checks whether the tablename is not already used in model.
|
boolean |
isRemoteEnabled() |
boolean |
isTableNameNecessary()
Checks whether entity needs a tablename.
|
Boolean |
isTableNameValid()
Checks whether tablename set properly by the user.
|
void |
setClassId(Integer classId) |
void |
setDomainImplementation(String domainImplementation) |
void |
setDomainInterface(String domainInterface) |
void |
setEntityName(String entityName) |
void |
setInheritanceType(InheritanceType inheritanceType) |
void |
setLongDescription(String longDescription) |
void |
setPersistenceImplementation(String persistenceImplementation) |
void |
setPersistenceInterface(String persistenceInterface) |
void |
setProfile(PdoProfile profile) |
void |
setRemoteEnabled(boolean remoteEnabled) |
void |
setShortDescription(String shortDescription) |
void |
setStatusDir(File statusDir)
Sets the status directory.
|
void |
setSuperEntity(Entity superEntity) |
void |
setTableName(String tableName) |
createFreemarkerConfiguration, getDefaultScopes, setTemplateDirectory, validatepublic void setStatusDir(File statusDir)
statusDir - the status dirpublic List<org.tentackle.validate.ValidationResult> generate() throws IOException, freemarker.template.TemplateException
IOException - if file creation failedfreemarker.template.TemplateException - if code generation failedpublic boolean isNewEntity()
public boolean isNewClassId()
public boolean isClassIdNecessary()
public boolean isNewTableName()
public boolean isTableNameNecessary()
public Boolean isTableNameValid()
public boolean isInheritanceTypeValid()
@Bindable @NotNull public PdoProfile getProfile()
@Bindable public void setProfile(PdoProfile profile)
@Bindable
@NotNull(message="missing entity name")
@True(value="$isNewEntity",
scope=org.tentackle.validate.scope.InteractiveScope.class,
message="entity already exists")
public String getEntityName()
@Bindable public void setEntityName(String entityName)
@Bindable
@True(value="$isNewClassId",
scope=org.tentackle.validate.scope.InteractiveScope.class,
message="class ID already in use")
@Changeable(condition="$isClassIdNecessary")
@GreaterOrEqual(value="100",
condition="$isClassIdNecessary",
message="class IDs below 100 are reserved for tentackle",
scope=org.tentackle.validate.scope.InteractiveScope.class)
@NotNull(condition="$isClassIdNecessary",
message="missing class ID")
public Integer getClassId()
@Bindable public void setClassId(Integer classId)
@Bindable(options="lc")
@True(value="$isNewTableName",
scope=org.tentackle.validate.scope.InteractiveScope.class,
message="table name already in use")
@Changeable(condition="$isTableNameNecessary")
@NotNull(value="$isTableNameValid",
condition="$isTableNameNecessary",
message="missing table name")
public String getTableName()
@Bindable public void setTableName(String tableName)
@Bindable public Entity getSuperEntity()
@Bindable public void setSuperEntity(Entity superEntity)
@Bindable
@NotNull
@True(value="$isInheritanceTypeValid",
scope=org.tentackle.validate.scope.InteractiveScope.class,
message="inheritance type does not match super entity")
public InheritanceType getInheritanceType()
@Bindable public void setInheritanceType(InheritanceType inheritanceType)
@Bindable @NotNull(message="missing short description") public String getShortDescription()
@Bindable public void setShortDescription(String shortDescription)
@Bindable public String getLongDescription()
@Bindable public void setLongDescription(String longDescription)
@Bindable @NotNull(message="missing domain interface") public String getDomainInterface()
@Bindable public void setDomainInterface(String domainInterface)
@Bindable @NotNull(message="missing persistence interface") public String getPersistenceInterface()
@Bindable public void setPersistenceInterface(String persistenceInterface)
@Bindable public String getDomainImplementation()
@Bindable public void setDomainImplementation(String domainImplementation)
@Bindable public String getPersistenceImplementation()
@Bindable public void setPersistenceImplementation(String persistenceImplementation)
@Bindable public boolean isRemoteEnabled()
@Bindable public void setRemoteEnabled(boolean remoteEnabled)
public String getSuperPdoInterface()
public String getSuperDomainInterface()
public String getSuperPersistenceInterface()
public String getSuperDomainImplementation()
public String getSuperPersistenceImplementation()
Tentackle - distributed, domain- and model-driven