Class DatabaseObjectDefinition

    • Field Detail

      • name

        public java.lang.String name
      • qualifier

        public java.lang.String qualifier
    • Constructor Detail

      • DatabaseObjectDefinition

        public DatabaseObjectDefinition()
    • Method Detail

      • getFieldTypeDefinition

        protected static final FieldTypeDefinition getFieldTypeDefinition​(AbstractSession session,
                                                                          java.lang.Class type,
                                                                          java.lang.String name)
        INTERNAL: Retrieve a database platform specific definition from session for existing type instance or build a new one when type is null.
        Parameters:
        session - Session to search for already existing instances.
        type - Field type class.
        name - Filed type name.
        Returns:
        Database platform specific definition instance.
        Throws:
        ValidationException - when provided type is not valid database type.
      • getFieldTypeDefinition

        protected static final FieldTypeDefinition getFieldTypeDefinition​(DatabasePlatform platform,
                                                                          java.lang.Class type,
                                                                          java.lang.String name)
        INTERNAL: Retrieve database platform specific field definition from database specific platform handler for existing type or build a new one when type is null and type for type name could not be found.
        Parameters:
        platform - Specific database platform handler.
        type - Field type (will be processed first when available).
        name - Field type name (will be processed as backup option when type class is not available).
        Throws:
        ValidationException - when provided type is not valid database type.
      • buildVPDCreationPolicyWriter

        public java.io.Writer buildVPDCreationPolicyWriter​(AbstractSession session,
                                                           java.io.Writer writer)
        INTERNAL: Sub classes should override.
      • buildVPDCreationFunctionWriter

        public java.io.Writer buildVPDCreationFunctionWriter​(AbstractSession session,
                                                             java.io.Writer writer)
        INTERNAL: Sub classes should override.
      • buildVPDDeletionWriter

        public java.io.Writer buildVPDDeletionWriter​(AbstractSession session,
                                                     java.io.Writer writer)
        INTERNAL: Sub classes should override.
      • clone

        public java.lang.Object clone()
        PUBLIC:
        Overrides:
        clone in class java.lang.Object
      • createDatabaseSchema

        public void createDatabaseSchema​(AbstractSession session,
                                         java.io.Writer writer,
                                         java.util.Set<java.lang.String> createdDatabaseSchemas)
                                  throws EclipseLinkException
        INTERNAL: Execute the DDL to create the database schema for this object. Does nothing at this level, subclasses that support this must override this method.
        Throws:
        EclipseLinkException
        See Also:
        TableDefinition
      • createDatabaseSchemaOnDatabase

        public void createDatabaseSchemaOnDatabase​(AbstractSession session,
                                                   java.util.Set<java.lang.String> createdDatabaseSchemas)
                                            throws EclipseLinkException
        INTERNAL: Execute the DDL to create the database schema for this object. Does nothing at this level, subclasses that support this must override this method.
        Throws:
        EclipseLinkException
        See Also:
        TableDefinition
      • createObject

        public void createObject​(AbstractSession session,
                                 java.io.Writer schemaWriter)
                          throws EclipseLinkException
        INTERNAL: Either drop from the database directly or write the statement to a file. Database objects are root level entities such as tables, views, procs, sequences...
        Throws:
        EclipseLinkException
      • shouldCreateDatabaseSchema

        public boolean shouldCreateDatabaseSchema​(java.util.Set<java.lang.String> createdDatabaseSchemas)
        INTERNAL: Subclasses who care should override this method, e.g. TableDefinition.
      • shouldCreateVPDCalls

        public boolean shouldCreateVPDCalls​(AbstractSession session)
        INTERNAL: Subclasses who care should override this method.
      • dropObject

        public void dropObject​(AbstractSession session,
                               java.io.Writer schemaWriter,
                               boolean createSQLFiles)
                        throws EclipseLinkException
        INTERNAL: Execute the DDL to drop the object. Either directly from the database of write out the statement to a file.
        Throws:
        EclipseLinkException
      • getDatabaseSchema

        public java.lang.String getDatabaseSchema()
        PUBLIC: Return the database schema associated with this database object.
        See Also:
        TableDefinition
      • getFullName

        public java.lang.String getFullName()
        INTERNAL: Most major databases support a creator name scope. This means whenever the database object is referenced, it must be qualified.
      • getName

        public java.lang.String getName()
        PUBLIC: Return the name of the object. i.e. the table name or the sequence name.
      • getQualifier

        public java.lang.String getQualifier()
        PUBLIC: Most major databases support a creator name scope. This means whenever the database object is referenced, it must be qualified.
      • hasDatabaseSchema

        protected boolean hasDatabaseSchema()
        INTERNAL: Return true is this database object definition has a schema definition.
      • postCreateObject

        public void postCreateObject​(AbstractSession session,
                                     java.io.Writer createSchemaWriter,
                                     boolean createSQLFiles)
        Execute any statements required after the creation of the object
        Parameters:
        session -
        createSchemaWriter -
      • preDropObject

        public void preDropObject​(AbstractSession session,
                                  java.io.Writer dropSchemaWriter,
                                  boolean createSQLFiles)
        Execute any statements required before the deletion of the object
        Parameters:
        session -
        dropSchemaWriter -
      • setName

        public void setName​(java.lang.String name)
        PUBLIC: Set the name of the object. i.e. the table name or the sequence name.
      • setQualifier

        public void setQualifier​(java.lang.String qualifier)
        PUBLIC: Most major databases support a creator name scope. This means whenever the database object is referenced, it must be qualified.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object