APIdia Launch Partner
Top Description Fields Constructors Methods
io.github.spannm.jackcess.impl

public Class RelationshipCreator

extends DBMutator
Class Inheritance
Imports
io.github.spannm.jackcess.ConstraintViolationException, .IndexBuilder, .IndexCursor, .Relationship, .RelationshipBuilder, .Row, io.github.spannm.jackcess.util.ToStringBuilder, java.io.IOException, java.util.ArrayDeque, .ArrayList, .Collection, .Deque, .HashMap, .HashSet, .List, .Map, .Set

Helper class used to maintain state during relationship creation.

Field Summary

Modifier and TypeField and Description
private static final int
private int
private static final byte
private static final byte
private String
private List<ColumnImpl>
private TableImpl
private RelationshipBuilder
private List<ColumnImpl>
private TableImpl

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
private void
private void
checkForCascadeCycle()

Verifies that enabling cascading updates/deletes for the relationship currently being created would not introduce a cascade cycle, i.e. a chain of cascading relationships (including this new one) that loops back to the primary table.

private IndexImpl.ForeignKeyReference
createFKReference(boolean isPrimary)

private static IndexBuilder
private IndexBuilder
private String
public RelationshipImpl
createRelationship(RelationshipBuilder relBuilder)

Creates the relationship in the database.

public RelationshipImpl
private IndexBuilder
private static List<String>
private static List<ColumnImpl>
getColumns(TableImpl table, List<String> colNames)

public String
public TableImpl
public TableImpl
private static String
private static IndexImpl
public boolean
private boolean
private void
private String
Inherited from io.github.spannm.jackcess.impl.DBMutator:
calculateNameLengthgetCharsetgetDatabasegetDbSortOrdergetFormatgetPageChannelreservePageNumber

Field Detail

CASCADE_FLAGSback to summary
private static final int CASCADE_FLAGS
flagsback to summary
private int flags
IGNORED_PRIMARY_INDEX_FLAGSback to summary
private static final byte IGNORED_PRIMARY_INDEX_FLAGS
IGNORED_SECONDARY_INDEX_FLAGSback to summary
private static final byte IGNORED_SECONDARY_INDEX_FLAGS
nameback to summary
private String name
primaryColsback to summary
private List<ColumnImpl> primaryCols
primaryTableback to summary
private TableImpl primaryTable
relationshipback to summary
private RelationshipBuilder relationship
secondaryColsback to summary
private List<ColumnImpl> secondaryCols
secondaryTableback to summary
private TableImpl secondaryTable

Constructor Detail

RelationshipCreatorback to summary
public RelationshipCreator(DatabaseImpl database)

Method Detail

addPrimaryIndexback to summary
private void addPrimaryIndex() throws IOException
addSecondaryIndexback to summary
private void addSecondaryIndex() throws IOException
checkForCascadeCycleback to summary
private void checkForCascadeCycle() throws IOException

Verifies that enabling cascading updates/deletes for the relationship currently being created would not introduce a cascade cycle, i.e. a chain of cascading relationships (including this new one) that loops back to the primary table. Following such a cycle would cause an infinite cascade when the relationship is enforced.

createFKReferenceback to summary
private IndexImpl.ForeignKeyReference createFKReference(boolean isPrimary)
createIndexback to summary
private static IndexBuilder createIndex(String name, List<ColumnImpl> cols)
createPrimaryIndexback to summary
private IndexBuilder createPrimaryIndex()
createPrimaryIndexNameback to summary
private String createPrimaryIndexName()
createRelationshipback to summary
public RelationshipImpl createRelationship(RelationshipBuilder relBuilder) throws IOException

Creates the relationship in the database.

createRelationshipImplback to summary
public RelationshipImpl createRelationshipImpl(String relName)
createSecondaryIndexback to summary
private IndexBuilder createSecondaryIndex()
getColumnNamesback to summary
private static List<String> getColumnNames(List<ColumnImpl> cols)
getColumnsback to summary
private static List<ColumnImpl> getColumns(TableImpl table, List<String> colNames)
getNameback to summary
public String getName()
getPrimaryTableback to summary
public TableImpl getPrimaryTable()
getSecondaryTableback to summary
public TableImpl getSecondaryTable()
getTableErrorContextback to summary
private static String getTableErrorContext(TableImpl table, List<ColumnImpl> cols, String tableName, Collection<String> colNames)
getUniqueIndexback to summary
private static IndexImpl getUniqueIndex(TableImpl table, List<ColumnImpl> cols)
hasReferentialIntegrityback to summary
public boolean hasReferentialIntegrity()
isOneToOneback to summary
private boolean isOneToOne()
validateback to summary
private void validate() throws IOException
withErrorContextback to summary
private String withErrorContext(String msg)