public class DBRelation extends DBObject
| Modifier and Type | Class and Description |
|---|---|
static class |
DBRelation.DBCascadeAction
DBCascadeAction enum
This enum specifies options for a relation when deleting records
(see DBRelation.setOnDeleteAction)
- NONE: No Action is performed and the operation will fail if depending records exist
|
static class |
DBRelation.DBReference |
| Constructor and Description |
|---|
DBRelation(DBDatabase db,
String name,
DBRelation.DBReference[] references)
Creates a DBRelation object for a foreing key relation.
|
DBRelation(DBDatabase db,
String name,
DBRelation.DBReference[] references,
DBRelation.DBCascadeAction onDeleteAction)
Creates a DBRelation object for a foreing key relation.
|
| Modifier and Type | Method and Description |
|---|---|
DBDatabase |
getDatabase()
Returns the database object to which this object belongs to.
|
String |
getEnableDisableStmt(boolean enable,
DBContext context)
Appends the required DLL command to enable or disable a foreign key constraint to the supplied DBDQLScript.
|
DBTable |
getForeignKeyTable()
Returns the table that is containing the foreign key (source table)
|
String |
getFullName()
Returns the full qualified table name.
|
String |
getName()
Returns the name.
|
DBRelation.DBCascadeAction |
getOnDeleteAction()
return the action to perform when deleting affected records.
|
DBTable |
getReferencedTable()
Returns the table that is referenced by this foreign key relation (target table)
|
DBRelation.DBReference[] |
getReferences()
Returns the references.
|
void |
onDeleteCascade()
short for
setOnDeleteAction(DBCascadeAction.CASCADE);
See DBCascadeAction enum for details.
|
void |
onDeleteCascadeRecords()
short for
setOnDeleteAction(DBCascadeAction.CASCADE);
See DBCascadeAction enum for details.
|
void |
setOnDeleteAction(DBRelation.DBCascadeAction onDeleteAction)
sets the action taken when deleting records that affect this foreign key relation
See DBCascadeAction enum for details.
|
String |
toString() |
checkParamNullpublic DBRelation(DBDatabase db, String name, DBRelation.DBReference[] references, DBRelation.DBCascadeAction onDeleteAction)
db - the database objectname - the namereferences - the references for this relationonDeleteAction - specifies the action performed when deleting affected records.public DBRelation(DBDatabase db, String name, DBRelation.DBReference[] references)
db - the database objectname - the namereferences - the references for this relationpublic String getName()
public String getFullName()
public DBRelation.DBReference[] getReferences()
public DBTable getForeignKeyTable()
public DBTable getReferencedTable()
public final DBDatabase getDatabase()
DBObjectgetDatabase in class DBObjectpublic DBRelation.DBCascadeAction getOnDeleteAction()
public void setOnDeleteAction(DBRelation.DBCascadeAction onDeleteAction)
onDeleteAction - the action to perform when deleting affected recordspublic void onDeleteCascade()
setOnDeleteAction(DBCascadeAction.CASCADE);See DBCascadeAction enum for details.
public void onDeleteCascadeRecords()
setOnDeleteAction(DBCascadeAction.CASCADE);See DBCascadeAction enum for details.
public String getEnableDisableStmt(boolean enable, DBContext context)
enable - true if the constraint should be enabled or false to disable the constraintcontext - the context for which to enable or disable the relationCopyright © 2008–2023 Apache Software Foundation. All rights reserved.