Class DatabaseModelGenerator


  • public class DatabaseModelGenerator
    extends java.lang.Object
    Responsible for creating in memory DB Model. This class creates a table each for all non abstract Items that re read from YTypeSystem. Attributes and indices are included recursively.GenericItem is the first nonabstract Item in the chain that has deployment. In this case a new table will be created with all the attributes of super types. For the next nonabstract item i.e Product another table named Products will be generated which contains attributes of Product(code,name, unit,description) + attributes of super types(i.e createdTime, modifiedTime pk etc). In case of non abstract items that are not having an own deployment,parent deployment will be used. i.e Attributes of TestItem (name, description) will be added to table genericitems.
    • Method Detail

      • createDatabaseModel

        public YDbModel createDatabaseModel()
      • canReuseExistingColumnForAttribute

        protected boolean canReuseExistingColumnForAttribute​(YColumn existingColumn,
                                                             YAttributeDescriptor attributeDescriptor,
                                                             YTable targetTable)
      • getCustomPersistenceType

        protected java.lang.String getCustomPersistenceType​(YAttributeDescriptor attr)
      • getDefaultPersistenceJavaType

        protected java.lang.String getDefaultPersistenceJavaType​(YAttributeDescriptor attr)
      • getCustomPersistenceTypeFromAttribute

        protected java.lang.String getCustomPersistenceTypeFromAttribute​(YAttributeDescriptor attr)
      • getCustomPersistenceTypeFromAttributeDeployment

        protected java.lang.String getCustomPersistenceTypeFromAttributeDeployment​(YAttributeDescriptor attr)
      • getPersistenceJavaTypeFromAttributeDeployment

        protected java.lang.String getPersistenceJavaTypeFromAttributeDeployment​(YAttributeDescriptor attr)
      • getDefaultUnlocalizedColumnPersistenceJavaType

        protected java.lang.String getDefaultUnlocalizedColumnPersistenceJavaType​(YType type)
      • getDefaulLocalizedColumnPersistenceJavaType

        protected java.lang.String getDefaulLocalizedColumnPersistenceJavaType​(YMapType type)
      • createSystemTables

        protected void createSystemTables()
        Creates system tables which are outside type system