public class DatabaseRelationDefinition extends RelationDefinition
| Modifier | Constructor and Description |
|---|---|
protected |
DatabaseRelationDefinition(RelationID name)
used only in DBMetadata
|
| Modifier and Type | Method and Description |
|---|---|
Attribute |
addAttribute(QuotedID id,
String typeName,
DBTermType termType,
boolean canNull)
creates a new attribute
|
void |
addForeignKeyConstraint(ForeignKeyConstraint fk)
adds a foreign key constraints
|
void |
addFunctionalDependency(FunctionalDependency constraint) |
void |
addUniqueConstraint(UniqueConstraint uc)
adds a unique constraint (a primary key or a unique constraint proper)
|
Attribute |
getAttribute(int index)
gets attribute with the specified position
|
Attribute |
getAttribute(QuotedID attributeId)
return an attribute with the specified ID
|
List<Attribute> |
getAttributes()
returns the list of attributes
|
com.google.common.collect.ImmutableList<ForeignKeyConstraint> |
getForeignKeys()
returns the list of foreign key constraints
|
com.google.common.collect.ImmutableList<FunctionalDependency> |
getOtherFunctionalDependencies() |
UniqueConstraint |
getPrimaryKey()
return primary key (if present) or null (otherwise)
|
com.google.common.collect.ImmutableList<UniqueConstraint> |
getUniqueConstraints()
returns the list of unique constraints (including the primary key if present)
|
String |
toString() |
getAtomPredicate, getIDprotected DatabaseRelationDefinition(RelationID name)
name - public Attribute addAttribute(QuotedID id, String typeName, DBTermType termType, boolean canNull)
id - typeName - termType - canNull - public Attribute getAttribute(QuotedID attributeId)
attributeId - public Attribute getAttribute(int index)
getAttribute in class RelationDefinitionindex - is position starting at 1public List<Attribute> getAttributes()
getAttributes in class RelationDefinitionpublic void addUniqueConstraint(UniqueConstraint uc)
uc - public com.google.common.collect.ImmutableList<UniqueConstraint> getUniqueConstraints()
getUniqueConstraints in class RelationDefinitionpublic void addFunctionalDependency(FunctionalDependency constraint)
public com.google.common.collect.ImmutableList<FunctionalDependency> getOtherFunctionalDependencies()
getOtherFunctionalDependencies in class RelationDefinitionpublic UniqueConstraint getPrimaryKey()
getPrimaryKey in class RelationDefinitionpublic void addForeignKeyConstraint(ForeignKeyConstraint fk)
fk - a foreign keypublic com.google.common.collect.ImmutableList<ForeignKeyConstraint> getForeignKeys()
getForeignKeys in class RelationDefinitionCopyright © 2009–2020 Free University of Bozen-Bolzano. All rights reserved.