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
Generator for the PDO files.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionList<org.tentackle.validate.ValidationResult>generate()Creates the PDO files.Gets the name of the parent domain class.Gets the name of the parent domain interface.Gets the name of the parent pdo interface.Gets the name of the parent persistence class.Gets the name of the parent persistence interface.booleanChecks whether entity needs a class ID.booleanbooleanChecks whether classID is not already used in model.booleanChecks whether entity name is not already used in model.booleanChecks whether the tablename is not already used in model.booleanbooleanReturns whether extending a super entity is allowed.booleanChecks whether entity needs a tablename.Checks whether tablename set properly by the user.voidsetClassId(Integer classId) voidsetDomainImplementation(String domainImplementation) voidsetDomainInterface(String domainInterface) voidsetEntityName(String entityName) voidsetInheritanceType(InheritanceType inheritanceType) voidsetLongDescription(String longDescription) voidsetPersistenceImplementation(String persistenceImplementation) voidsetPersistenceInterface(String persistenceInterface) voidsetProfile(PdoProfile profile) voidsetRemoteEnabled(boolean remoteEnabled) voidsetShortDescription(String shortDescription) voidsetStatusDir(File statusDir) Sets the status directory.voidsetSuperEntity(Entity superEntity) voidsetTableName(String tableName) Methods inherited from class org.tentackle.maven.plugin.wizard.AbstractValidateableGenerator
getDefaultScopesMethods inherited from class org.tentackle.maven.AbstractGenerator
createFreemarkerConfiguration, getLogger, getTemplateDirectory, setLogger, setTemplateDirectoryMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tentackle.validate.Validateable
validate
-
Constructor Details
-
PdoGenerator
public PdoGenerator()
-
-
Method Details
-
setStatusDir
Sets the status directory.- Parameters:
statusDir- the status dir
-
generate
public List<org.tentackle.validate.ValidationResult> generate() throws IOException, freemarker.template.TemplateExceptionCreates the PDO files.- Returns:
- the validation results, empty if okay, never null
- Throws:
IOException- if file creation failedfreemarker.template.TemplateException- if code generation failed
-
isNewEntity
Checks whether entity name is not already used in model.- Returns:
- true if ok
- Throws:
ModelException- if failed
-
isNewClassId
Checks whether classID is not already used in model.- Returns:
- true if ok
- Throws:
ModelException- if failed
-
isClassIdNecessary
public boolean isClassIdNecessary()Checks whether entity needs a class ID.- Returns:
- true if class ID necessary
-
isSuperEntityAllowed
public boolean isSuperEntityAllowed()Returns whether extending a super entity is allowed.- Returns:
- true if allowed, else no inheritance
-
isNewTableName
Checks whether the tablename is not already used in model.- Returns:
- true if ok
- Throws:
ModelException- if failed
-
isTableNameNecessary
public boolean isTableNameNecessary()Checks whether entity needs a tablename.- Returns:
- true if tablename necessary
-
isTableNameValid
Checks whether tablename set properly by the user.- Returns:
- true if set, false if missing
-
isInheritanceTypeValid
public boolean isInheritanceTypeValid() -
getProfile
-
setProfile
-
getEntityName
@Bindable @NotNull(message="missing entity name") @True(value="$isNewEntity", scope=org.tentackle.validate.scope.InteractiveScope.class, message="entity already exists") public String getEntityName() -
setEntityName
-
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 Integer getClassId() -
setClassId
-
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 String getTableName() -
setTableName
-
getSuperEntity
-
setSuperEntity
-
getInheritanceType
@Bindable @NotNull @True(value="$isInheritanceTypeValid", scope=org.tentackle.validate.scope.InteractiveScope.class, message="inheritance type does not match super entity") public InheritanceType getInheritanceType() -
setInheritanceType
-
getShortDescription
-
setShortDescription
-
getLongDescription
-
setLongDescription
-
getDomainInterface
-
setDomainInterface
-
getPersistenceInterface
-
setPersistenceInterface
-
getDomainImplementation
-
setDomainImplementation
-
getPersistenceImplementation
-
setPersistenceImplementation
-
isRemoteEnabled
@Bindable public boolean isRemoteEnabled() -
setRemoteEnabled
@Bindable public void setRemoteEnabled(boolean remoteEnabled) -
getSuperPdoInterface
Gets the name of the parent pdo interface.- Returns:
- the super interface
-
getSuperDomainInterface
Gets the name of the parent domain interface.- Returns:
- the super domain interface
-
getSuperPersistenceInterface
Gets the name of the parent persistence interface.- Returns:
- the super persistence interface
-
getSuperDomainImplementation
Gets the name of the parent domain class.- Returns:
- the super domain class
-
getSuperPersistenceImplementation
Gets the name of the parent persistence class.- Returns:
- the super persistence class
-