Class PdoGenerator

  • All Implemented Interfaces:
    org.tentackle.validate.ScopeConfigurator, org.tentackle.validate.Validateable

    public class PdoGenerator
    extends AbstractValidateableGenerator
    Generator for the PDO files.
    • Constructor Detail

      • PdoGenerator

        public PdoGenerator()
    • 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.TemplateException
        Creates the PDO files.
        Returns:
        the validation results, empty if okay, never null
        Throws:
        java.io.IOException - if file creation failed
        freemarker.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