diff options
Diffstat (limited to 'src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java')
-rw-r--r-- | src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java index a6cba97..ae68a17 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java @@ -1994,6 +1994,11 @@ public class ColumnImpl implements Column, Comparable<ColumnImpl> { public abstract Object getNext(Object prevRowValue); /** + * Restores a previous autonumber generated by this generator. + */ + public abstract void restoreLast(Object last); + + /** * Returns the type of values generated by this generator. */ public abstract DataType getType(); @@ -2016,6 +2021,13 @@ public class ColumnImpl implements Column, Comparable<ColumnImpl> { } @Override + public void restoreLast(Object last) { + if(last instanceof Integer) { + getTable().restoreLastLongAutoNumber((Integer)last); + } + } + + @Override public DataType getType() { return DataType.LONG; } @@ -2040,6 +2052,11 @@ public class ColumnImpl implements Column, Comparable<ColumnImpl> { } @Override + public void restoreLast(Object last) { + _lastAutoNumber = null; + } + + @Override public DataType getType() { return DataType.GUID; } @@ -2067,6 +2084,14 @@ public class ColumnImpl implements Column, Comparable<ColumnImpl> { } @Override + public void restoreLast(Object last) { + if(last instanceof ComplexValueForeignKey) { + getTable().restoreLastComplexTypeAutoNumber( + ((ComplexValueForeignKey)last).get()); + } + } + + @Override public DataType getType() { return DataType.COMPLEX_TYPE; } @@ -2091,6 +2116,11 @@ public class ColumnImpl implements Column, Comparable<ColumnImpl> { } @Override + public void restoreLast(Object last) { + throw new UnsupportedOperationException(); + } + + @Override public DataType getType() { return _genType; } |