From: James Ahlborn Date: Wed, 20 Mar 2013 01:51:12 +0000 (+0000) Subject: util method for getting new RowId X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=596d83898a3ba6cfcbcb80dde9431dea93e18be9;p=jackcess.git util method for getting new RowId git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/jackcess-2@698 f203690c-595d-4dc9-a70b-905162fa7fd2 --- diff --git a/src/java/com/healthmarketscience/jackcess/complex/ComplexColumnInfo.java b/src/java/com/healthmarketscience/jackcess/complex/ComplexColumnInfo.java index ae17510..3b9ab66 100644 --- a/src/java/com/healthmarketscience/jackcess/complex/ComplexColumnInfo.java +++ b/src/java/com/healthmarketscience/jackcess/complex/ComplexColumnInfo.java @@ -273,7 +273,8 @@ public abstract class ComplexColumnInfo protected ComplexValueIdImpl getValueId(Object[] row) { int idVal = (Integer)getPrimaryKeyColumn().getRowValue(row); - return new ComplexValueIdImpl(idVal, (RowId)row[row.length - 1]); + return new ComplexValueIdImpl(idVal, + ((TableImpl)_flatTable).getRowId(row)); } protected Object[] asRow(Object[] row, V value) { diff --git a/src/java/com/healthmarketscience/jackcess/impl/TableImpl.java b/src/java/com/healthmarketscience/jackcess/impl/TableImpl.java index 919c17f..ae5a33a 100644 --- a/src/java/com/healthmarketscience/jackcess/impl/TableImpl.java +++ b/src/java/com/healthmarketscience/jackcess/impl/TableImpl.java @@ -1281,6 +1281,15 @@ public class TableImpl implements Table return asRow(rowMap, Column.KEEP_VALUE, false); } + /** + * @return the generated RowId added to a row of values created via {@link + * #asRowWithRowId} + * @usage _intermediate_method_ + */ + public RowId getRowId(Object[] row) { + return (RowId)row[_columns.size()]; + } + /** * Converts a map of columnName -> columnValue to an array of row values. */