Class PdoGenerator
- java.lang.Object
-
- org.tentackle.maven.AbstractGenerator
-
- org.tentackle.maven.plugin.wizard.AbstractValidateableGenerator
-
- org.tentackle.maven.plugin.wizard.PdoGenerator
-
- All Implemented Interfaces:
org.tentackle.validate.ScopeConfigurator,org.tentackle.validate.Validateable
public class PdoGenerator extends AbstractValidateableGenerator
Generator for the PDO files.
-
-
Constructor Summary
Constructors Constructor Description PdoGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<org.tentackle.validate.ValidationResult>generate()Creates the PDO files.java.lang.IntegergetClassId()java.lang.StringgetDomainImplementation()java.lang.StringgetDomainInterface()java.lang.StringgetEntityName()org.tentackle.model.InheritanceTypegetInheritanceType()java.lang.StringgetLongDescription()java.lang.StringgetPersistenceImplementation()java.lang.StringgetPersistenceInterface()PdoProfilegetProfile()java.lang.StringgetShortDescription()java.lang.StringgetSuperDomainImplementation()Gets the name of the parent domain class.java.lang.StringgetSuperDomainInterface()Gets the name of the parent domain interface.org.tentackle.model.EntitygetSuperEntity()java.lang.StringgetSuperPdoInterface()Gets the name of the parent pdo interface.java.lang.StringgetSuperPersistenceImplementation()Gets the name of the parent persistence class.java.lang.StringgetSuperPersistenceInterface()Gets the name of the parent persistence interface.java.lang.StringgetTableName()booleanisClassIdNecessary()Checks whether entity needs a class ID.booleanisInheritanceTypeValid()booleanisNewClassId()Checks whether classID is not already used in model.booleanisNewEntity()Checks whether entity name is not already used in model.booleanisNewTableName()Checks whether the tablename is not already used in model.booleanisRemoteEnabled()booleanisTableNameNecessary()Checks whether entity needs a tablename.java.lang.BooleanisTableNameValid()Checks whether tablename set properly by the user.voidsetClassId(java.lang.Integer classId)voidsetDomainImplementation(java.lang.String domainImplementation)voidsetDomainInterface(java.lang.String domainInterface)voidsetEntityName(java.lang.String entityName)voidsetInheritanceType(org.tentackle.model.InheritanceType inheritanceType)voidsetLongDescription(java.lang.String longDescription)voidsetPersistenceImplementation(java.lang.String persistenceImplementation)voidsetPersistenceInterface(java.lang.String persistenceInterface)voidsetProfile(PdoProfile profile)voidsetRemoteEnabled(boolean remoteEnabled)voidsetShortDescription(java.lang.String shortDescription)voidsetStatusDir(java.io.File statusDir)Sets the status directory.voidsetSuperEntity(org.tentackle.model.Entity superEntity)voidsetTableName(java.lang.String tableName)-
Methods inherited from class org.tentackle.maven.plugin.wizard.AbstractValidateableGenerator
getDefaultScopes, validate
-
-
-
-
Method Detail
-
setStatusDir
public void setStatusDir(java.io.File statusDir)
Sets the status directory.- Parameters:
statusDir- the status dir
-
generate
public java.util.List<org.tentackle.validate.ValidationResult> generate() throws java.io.IOException, freemarker.template.TemplateExceptionCreates the PDO files.- Returns:
- the validation results, empty if okay, never null
- Throws:
java.io.IOException- if file creation failedfreemarker.template.TemplateException- if code generation failed
-
isNewEntity
public boolean isNewEntity()
Checks whether entity name is not already used in model.- Returns:
- true if ok
-
isNewClassId
public boolean isNewClassId()
Checks whether classID is not already used in model.- Returns:
- true if ok
-
isClassIdNecessary
public boolean isClassIdNecessary()
Checks whether entity needs a class ID.- Returns:
- true if class ID necessary
-
isNewTableName
public boolean isNewTableName()
Checks whether the tablename is not already used in model.- Returns:
- true if ok
-
isTableNameNecessary
public boolean isTableNameNecessary()
Checks whether entity needs a tablename.- Returns:
- true if tablename necessary
-
isTableNameValid
public java.lang.Boolean isTableNameValid()
Checks whether tablename set properly by the user.- Returns:
- true if set, false if missing
-
isInheritanceTypeValid
public boolean isInheritanceTypeValid()
-
getProfile
@Bindable @NotNull public PdoProfile getProfile()
-
setProfile
@Bindable public void setProfile(PdoProfile profile)
-
getEntityName
@Bindable @NotNull(message="missing entity name") @True(value="$isNewEntity", scope=org.tentackle.validate.scope.InteractiveScope.class, message="entity already exists") public java.lang.String getEntityName()
-
setEntityName
@Bindable public void setEntityName(java.lang.String entityName)
-
getClassId
@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 java.lang.Integer getClassId()
-
setClassId
@Bindable public void setClassId(java.lang.Integer classId)
-
getTableName
@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 java.lang.String getTableName()
-
setTableName
@Bindable public void setTableName(java.lang.String tableName)
-
getSuperEntity
@Bindable public org.tentackle.model.Entity getSuperEntity()
-
setSuperEntity
@Bindable public void setSuperEntity(org.tentackle.model.Entity superEntity)
-
getInheritanceType
@Bindable @NotNull @True(value="$isInheritanceTypeValid", scope=org.tentackle.validate.scope.InteractiveScope.class, message="inheritance type does not match super entity") public org.tentackle.model.InheritanceType getInheritanceType()
-
setInheritanceType
@Bindable public void setInheritanceType(org.tentackle.model.InheritanceType inheritanceType)
-
getShortDescription
@Bindable @NotNull(message="missing short description") public java.lang.String getShortDescription()
-
setShortDescription
@Bindable public void setShortDescription(java.lang.String shortDescription)
-
getLongDescription
@Bindable public java.lang.String getLongDescription()
-
setLongDescription
@Bindable public void setLongDescription(java.lang.String longDescription)
-
getDomainInterface
@Bindable @NotNull(message="missing domain interface") public java.lang.String getDomainInterface()
-
setDomainInterface
@Bindable public void setDomainInterface(java.lang.String domainInterface)
-
getPersistenceInterface
@Bindable @NotNull(message="missing persistence interface") public java.lang.String getPersistenceInterface()
-
setPersistenceInterface
@Bindable public void setPersistenceInterface(java.lang.String persistenceInterface)
-
getDomainImplementation
@Bindable public java.lang.String getDomainImplementation()
-
setDomainImplementation
@Bindable public void setDomainImplementation(java.lang.String domainImplementation)
-
getPersistenceImplementation
@Bindable public java.lang.String getPersistenceImplementation()
-
setPersistenceImplementation
@Bindable public void setPersistenceImplementation(java.lang.String persistenceImplementation)
-
isRemoteEnabled
@Bindable public boolean isRemoteEnabled()
-
setRemoteEnabled
@Bindable public void setRemoteEnabled(boolean remoteEnabled)
-
getSuperPdoInterface
public java.lang.String getSuperPdoInterface()
Gets the name of the parent pdo interface.- Returns:
- the super interface
-
getSuperDomainInterface
public java.lang.String getSuperDomainInterface()
Gets the name of the parent domain interface.- Returns:
- the super domain interface
-
getSuperPersistenceInterface
public java.lang.String getSuperPersistenceInterface()
Gets the name of the parent persistence interface.- Returns:
- the super persistence interface
-
getSuperDomainImplementation
public java.lang.String getSuperDomainImplementation()
Gets the name of the parent domain class.- Returns:
- the super domain class
-
getSuperPersistenceImplementation
public java.lang.String getSuperPersistenceImplementation()
Gets the name of the parent persistence class.- Returns:
- the super persistence class
-
-