]> source.dussan.org Git - jackcess.git/commitdiff
util method for getting new RowId
authorJames Ahlborn <jtahlborn@yahoo.com>
Wed, 20 Mar 2013 01:51:12 +0000 (01:51 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Wed, 20 Mar 2013 01:51:12 +0000 (01:51 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/jackcess-2@698 f203690c-595d-4dc9-a70b-905162fa7fd2

src/java/com/healthmarketscience/jackcess/complex/ComplexColumnInfo.java
src/java/com/healthmarketscience/jackcess/impl/TableImpl.java

index ae1751070ddf2ff42999f8fc41a206a71fdd8e7f..3b9ab66e034795d0613395a2e491857452e1f126 100644 (file)
@@ -273,7 +273,8 @@ public abstract class ComplexColumnInfo<V extends ComplexValue>
 
   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) {
index 919c17ff8564cb9052131a75f25cbf67fad68506..ae5a33ae871898fa392a8ac034ae64ee6f278fc6 100644 (file)
@@ -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.
    */