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

pack-priv final Class FKEnforcer

extends Object
Class Inheritance
Imports
io.github.spannm.jackcess.Column, .ConstraintViolationException, .Index, .IndexCursor, .Row, .Table, io.github.spannm.jackcess.util.CaseInsensitiveColumnMatcher, .ColumnMatcher, .Joiner, java.io.IOException, java.util.ArrayList, .Arrays, .Collections, .List, .Set, .TreeSet

Utility class used by Table to enforce foreign-key relationships (if enabled).

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
FKEnforcer.SharedState

Shared state used by all FKEnforcers for a given Database.

Field Summary

Modifier and TypeField and Description
private List<ColumnImpl>
private static final ColumnMatcher
private List<Joiner>
private List<Joiner>
private List<Joiner>
private List<Joiner>
private List<Joiner>
private List<Joiner>
private final TableImpl

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
addRow(Object[]
new row in the Table's row format, including all values used in any foreign-key relationships
row
)

Handles foregn-key constraints when adding a row.

private boolean
anyUpdates(Object[] oldRow, Object[] newRow)

private static boolean
anyUpdates(Joiner joiner, Object[] oldRow, Object[] newRow)

private static boolean
areNull(Joiner joiner, Object[] row)

public void
deleteRow(Object[]
old row in the Table's row format, including all values used in any foreign-key relationships
row
)

Handles foregn-key constraints when deleting a row.

private boolean
private void
private void
initialize()

Does secondary initialization, if necessary.

pack-priv static FKEnforcer.SharedState
private static void
nullSecondaryValues(Joiner joiner, Object[] oldFromRow)

private static void
private static void
pack-priv void
reset()

Resets the internals of this FKEnforcer (for post-table modification)

public void
updateRow(Object[]
old row in the Table's row format, including all values used in any foreign-key relationships
oldRow
,
Object[]
new row in the Table's row format, including all values used in any foreign-key relationships
newRow
)

Handles foregn-key constraints when updating a row.

private static void
updateSecondaryValues(Joiner joiner, Object[] oldFromRow, Object[] newFromRow)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

colsback to summary
private List<ColumnImpl> cols
MATCHERback to summary
private static final ColumnMatcher MATCHER
primaryJoinersChkDelback to summary
private List<Joiner> primaryJoinersChkDel
primaryJoinersChkUpback to summary
private List<Joiner> primaryJoinersChkUp
primaryJoinersDoDelback to summary
private List<Joiner> primaryJoinersDoDel
primaryJoinersDoNullback to summary
private List<Joiner> primaryJoinersDoNull
primaryJoinersDoUpback to summary
private List<Joiner> primaryJoinersDoUp
secondaryJoinersback to summary
private List<Joiner> secondaryJoiners
tableback to summary
private final TableImpl table

Constructor Detail

FKEnforcerback to summary
pack-priv FKEnforcer(TableImpl table)

Method Detail

addRowback to summary
public void addRow(Object[] row) throws IOException

Handles foregn-key constraints when adding a row.

Parameters
row:Object[]

new row in the Table's row format, including all values used in any foreign-key relationships

anyUpdatesback to summary
private boolean anyUpdates(Object[] oldRow, Object[] newRow)
anyUpdatesback to summary
private static boolean anyUpdates(Joiner joiner, Object[] oldRow, Object[] newRow)
areNullback to summary
private static boolean areNull(Joiner joiner, Object[] row)
deleteRowback to summary
public void deleteRow(Object[] row) throws IOException

Handles foregn-key constraints when deleting a row.

Parameters
row:Object[]

old row in the Table's row format, including all values used in any foreign-key relationships

enforcingback to summary
private boolean enforcing()
initColumnsback to summary
private void initColumns()
initializeback to summary
private void initialize() throws IOException

Does secondary initialization, if necessary.

initSharedStateback to summary
pack-priv static FKEnforcer.SharedState initSharedState()
nullSecondaryValuesback to summary
private static void nullSecondaryValues(Joiner joiner, Object[] oldFromRow) throws IOException
requireNoSecondaryValuesback to summary
private static void requireNoSecondaryValues(Joiner joiner, Object[] row) throws IOException
requirePrimaryValuesback to summary
private static void requirePrimaryValues(Joiner joiner, Object[] row) throws IOException
resetback to summary
pack-priv void reset()

Resets the internals of this FKEnforcer (for post-table modification)

updateRowback to summary
public void updateRow(Object[] oldRow, Object[] newRow) throws IOException

Handles foregn-key constraints when updating a row.

Parameters
oldRow:Object[]

old row in the Table's row format, including all values used in any foreign-key relationships

newRow:Object[]

new row in the Table's row format, including all values used in any foreign-key relationships

updateSecondaryValuesback to summary
private static void updateSecondaryValues(Joiner joiner, Object[] oldFromRow, Object[] newFromRow) throws IOException
io.github.spannm.jackcess.impl back to summary

pack-priv final Class FKEnforcer.SharedState

extends Object
Class Inheritance

Shared state used by all FKEnforcers for a given Database.

Field Summary

Modifier and TypeField and Description
private int
updateDepth

current depth of cascading update calls across one or more tables

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

updateDepthback to summary
private int updateDepth

current depth of cascading update calls across one or more tables

Constructor Detail

SharedStateback to summary
private SharedState()

Method Detail

isUpdatingback to summary
public boolean isUpdating()
popUpdateback to summary
public void popUpdate()
pushUpdateback to summary
public void pushUpdate()