Relationship, and, optionally, the associated backing foreign key (if
referential integrity enforcement is enabled). A Relationship can only be constructed for Tables which
already exist in the Database. Additionally, if integrity enforcement is enabled, there must already be a
unique index on the "from" Table for the relevant columns (same requirement as MS Access).
Example:
Relationship rel = new RelationshipBuilder("FromTable", "ToTable")
.addColumns("ID", "FK_ID")
.setReferentialIntegrity()
.setCascadeDeletes()
.toRelationship(db);
TableBuilder
| Modifier and Type | Field and Description |
|---|---|
| private int | flags
relationship flags (default to "don't enforce") |
| private final List | |
| private final String | |
| private static final int | |
| private String | |
| private final List | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public RelationshipBuilder | |
| public RelationshipBuilder | |
| private RelationshipBuilder | |
| public int | |
| public List | |
| public String | |
| public String | |
| public List | |
| public String | |
| private boolean | |
| public boolean | |
| public Relationship | toRelationship(Database db)
Creates a new Relationship in the given Database with the currently configured attributes. |
| public RelationshipBuilder | |
| public RelationshipBuilder | withCascadeNullOnDelete()
Enables deletes in the "from" table to be cascaded as "null" to the "to" table. |
| public RelationshipBuilder | |
| private RelationshipBuilder | |
| public RelationshipBuilder | |
| public RelationshipBuilder | |
| public RelationshipBuilder |
| flags | back to summary |
|---|---|
| private int flags relationship flags (default to "don't enforce") | |
| fromCols | back to summary |
|---|---|
| private final List<String> fromCols | |
| fromTable | back to summary |
|---|---|
| private final String fromTable | |
| JOIN_FLAGS | back to summary |
|---|---|
| private static final int JOIN_FLAGS | |
| name | back to summary |
|---|---|
| private String name | |
| toCols | back to summary |
|---|---|
| private final List<String> toCols | |
| toTable | back to summary |
|---|---|
| private final String toTable | |
| RelationshipBuilder | back to summary |
|---|---|
| public RelationshipBuilder(Table fromTable, Table toTable) | |
| RelationshipBuilder | back to summary |
|---|---|
| public RelationshipBuilder(String fromTable, String toTable) | |
| addColumns | back to summary |
|---|---|
| public RelationshipBuilder addColumns(String fromCol, String toCol) Adds a pair of columns to the relationship. | |
| addColumns | back to summary |
|---|---|
| public RelationshipBuilder addColumns(Column fromCol, Column toCol) Adds a pair of columns to the relationship. | |
| clearFlag | back to summary |
|---|---|
| private RelationshipBuilder clearFlag(int flagMask) | |
| getFlags | back to summary |
|---|---|
| public int getFlags() | |
| getFromColumns | back to summary |
|---|---|
| public List | |
| getFromTable | back to summary |
|---|---|
| public String getFromTable() | |
| getName | back to summary |
|---|---|
| public String getName() | |
| getToColumns | back to summary |
|---|---|
| public List | |
| getToTable | back to summary |
|---|---|
| public String getToTable() | |
| hasFlag | back to summary |
|---|---|
| private boolean hasFlag(int flagMask) | |
| hasReferentialIntegrity | back to summary |
|---|---|
| public boolean hasReferentialIntegrity() | |
| toRelationship | back to summary |
|---|---|
| public Relationship toRelationship(Database db) throws IOException Creates a new Relationship in the given Database with the currently configured attributes. | |
| withCascadeDeletes | back to summary |
|---|---|
| public RelationshipBuilder withCascadeDeletes() Enables deletes to be cascaded from the "from" table to the "to" table. Note, this requires referential integrity to be enforced. | |
| withCascadeNullOnDelete | back to summary |
|---|---|
| public RelationshipBuilder withCascadeNullOnDelete() Enables deletes in the "from" table to be cascaded as "null" to the "to" table. Note, this requires referential integrity to be enforced. | |
| withCascadeUpdates | back to summary |
|---|---|
| public RelationshipBuilder withCascadeUpdates() Enables updates to be cascaded from the "from" table to the "to" table. Note, this requires referential integrity to be enforced. | |
| withFlag | back to summary |
|---|---|
| private RelationshipBuilder withFlag(int flagMask) | |
| withJoinType | back to summary |
|---|---|
| public RelationshipBuilder withJoinType(Relationship. Sets the preferred join type for this relationship. | |
| withName | back to summary |
|---|---|
| public RelationshipBuilder withName(String relationshipName) Sets a specific name for this relationship. Default = null, meaning that the standard Access naming convention will be used. | |
| withReferentialIntegrity | back to summary |
|---|---|
| public RelationshipBuilder withReferentialIntegrity() Enables referential integrity enforcement for this relationship. Note, this requires the "from" table to have an existing unique index on the relevant columns. | |