Interface DBEntityCapability

    • Field Detail

      • PROP_TABLE_NAME

        static final java.lang.String PROP_TABLE_NAME
        The 'tableName' property name.
        See Also:
        Constant Field Values
      • PROP_DOMAIN

        static final java.lang.String PROP_DOMAIN
        The JChem property table name, named "domain" for historical reasons. TODO see if this property can be removed
        See Also:
        Constant Field Values
      • PROP_DEFAULT_SORT

        static final java.lang.String PROP_DEFAULT_SORT
        XAttributes property name that describes default sort order of an entity. Expected format is fieldName ASC or fieldName DESC
        See Also:
        Constant Field Values
    • Method Detail

      • getTableName

        java.lang.String getTableName()
        Gets the simple name of the primary table. More information is available if you use the getTableInfos() method.
        Returns:
        The name of the primary table, it is not prefixed with the database schema.
      • getTableInfos

        com.im.commons.db.ddl.DBTableInfo[] getTableInfos()
        Gets the descriptions of the tables used by this entity. The DBTableInfo array contains table descriptors for all tables involved in this DBEntityCapability. The array is never empty and the table described by the first element is usually referred to as the primary table. The other tables are then called secondary tables.

        The exact number of table descriptors depends on each specific implementation. In some cases there will be just a single table involved in the entity and this method will only return one table descriptor. Other implementations may return descriptors for additional tables such as various JChem index tables, etc.

        Returns:
        The table descriptors for all the tables used by this entity. It's never null and never empty.
      • setTableName

        void setTableName​(java.lang.String tableName,
                          com.im.commons.progress.DFEnvironmentRW env)
        Sets the primary table name.
        Parameters:
        tableName - The new simple name for the primary table. The name is not supposed to be prefixed with the database schema name.
        env - rw environment to perform change in.
      • claimTableOwnership

        com.im.commons.db.ddl.DBTableInfo claimTableOwnership​(java.lang.String dbSchemaName,
                                                              java.lang.String table)
        Does this entity claim ownership to this table.
        Parameters:
        dbSchemaName - the database schema name
        table - The table name
        Returns:
        The primary table info for this table. Usually the table itself, but if the table is a secondary table for the entity the primary table name if returned. If the table does not belong to this entity null returned.
      • canDrop

        boolean canDrop()
      • getJoins

        com.im.commons.db.dml.SQLJoin[] getJoins()
        Returns the SQL joins for the entity.
        Returns:
        SQL joins
        Since:
        16.4.18