Package com.im.df.api.capabilities
Interface DBEntityCapability
-
- All Superinterfaces:
DFCapability
,PropertiesEditingConfigurable
- All Known Subinterfaces:
SqlEntityCapability
public interface DBEntityCapability extends DFCapability, PropertiesEditingConfigurable
The definition of an entity residing in a relational database, typically a database table. It will containDFField
s that typically correspond to columns in the table.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.im.df.api.support.PropertiesEditingConfigurable
PropertiesEditingConfigurable.Extra
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PROP_DEFAULT_SORT
XAttributes
property name that describes default sort order of an entity.static java.lang.String
PROP_DOMAIN
The JChem property table name, named "domain" for historical reasons.static java.lang.String
PROP_TABLE_NAME
The 'tableName' property name.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canDrop()
com.im.commons.db.ddl.DBTableInfo
claimTableOwnership(java.lang.String dbSchemaName, java.lang.String table)
Does this entity claim ownership to this table.com.im.commons.db.dml.SQLJoin[]
getJoins()
Returns the SQL joins for the entity.com.im.commons.db.ddl.DBTableInfo[]
getTableInfos()
Gets the descriptions of the tables used by this entity.java.lang.String
getTableName()
Gets the simple name of the primary table.void
setTableName(java.lang.String tableName, com.im.commons.progress.DFEnvironmentRW env)
Sets the primary table name.-
Methods inherited from interface com.im.df.api.support.PropertiesEditingConfigurable
isPropertyEditable
-
-
-
-
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 isfieldName ASC
orfieldName 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 thegetTableInfos()
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. TheDBTableInfo
array contains table descriptors for all tables involved in thisDBEntityCapability
. 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 nametable
- 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
-
-