public Object getFailedObject() { return _row.getFailedObject(); }
public OpenJPAStateManager getPrimaryKey() { return _row.getPrimaryKey(); }
public Table getTable() { return _row.getTable(); }
@Override public void insertBlobForStreamingLoad(Row row, Column col, JDBCStore store, Object ob, Select sel) throws SQLException { if (ob != null) { row.setBinaryStream(col, (InputStream)ob, -1); } else { row.setNull(col); } }
/** * Check to see if there is an insert for for the same table and primary * key values as the given delete row. */ private Row getInsertRow(Map insertMap, RowManagerImpl rowMgr, Row row) { if (insertMap == null) return null; OpenJPAStateManager sm = row.getPrimaryKey(); if (sm == null) return null; // look for a new object whose insert id is the same as this delete one Object oid = sm.getObjectId(); OpenJPAStateManager nsm = (OpenJPAStateManager) insertMap.get(oid); if (nsm == null) return null; // found new object; get its row row = rowMgr.getRow(row.getTable(), Row.ACTION_INSERT, nsm, false); return (row == null || row.isValid()) ? row : null; }
public Row getRow(Table table, int action, OpenJPAStateManager sm, boolean create) { while (sm != null && sm.getOwner() != null) sm = sm.getOwner(); if (_row != null && table == _row.getTable() && action == _row.getAction()) return _row; return new EmbeddedRow(_rm.getRow(table, action, sm, create)); }
insertMap = new HashMap((int) (inserts.size() * 1.33 + 1)); for (Iterator itr = inserts.iterator(); itr.hasNext();) { sm = ((Row) itr.next()).getPrimaryKey(); if (sm != null && sm.getObjectId() != null) insertMap.put(sm.getObjectId(), sm); if (row2 != null && row2.isValid() && row2 != row) graphs[1] = addEdge(graphs[1], (PrimaryRow) row2, row, fks[j]);
&& row.getTable() == relMapping.getTable()) row.wherePrimaryKey(rel); row.setForeignKey(fk, io, sm);
/** * Return true if the given column index is settable. */ private static boolean canSet(Row row, ColumnIO io, int i, boolean nullValue) { if (row.getAction() == Row.ACTION_INSERT) return io.isInsertable(i, nullValue); if (row.getAction() == Row.ACTION_UPDATE) return io.isUpdatable(i, nullValue); return true; }
public void flushAllRows(Row row) { if (!row.isValid()) return; switch (row.getAction()) { case Row.ACTION_UPDATE: if (_allRowUpdates == null) _allRowUpdates = new ArrayList<Row>(); _allRowUpdates.add(row); break; case Row.ACTION_DELETE: if (_allRowDeletes == null) _allRowDeletes = new ArrayList<Row>(); _allRowDeletes.add(row); break; default: throw new InternalException("action = " + row.getAction()); } }
public boolean isValid() { return _row.isValid(); }
public void setBinaryStream(Column col, InputStream val, int length) throws SQLException { _row.setBinaryStream(col, val, length); }
public void setBigDecimal(Column col, BigDecimal val) throws SQLException { _row.setBigDecimal(col, val); }
public void setBigInteger(Column col, BigInteger val) throws SQLException { _row.setBigInteger(col, val); }
public void setAsciiStream(Column col, InputStream val, int length) throws SQLException { _row.setAsciiStream(col, val, length); }
public void setArray(Column col, Array val) throws SQLException { _row.setArray(col, val); }
/** * Check to see if there is an insert for for the same table and primary * key values as the given delete row. */ private Row getInsertRow(Map insertMap, RowManagerImpl rowMgr, Row row) { if (insertMap == null) return null; OpenJPAStateManager sm = row.getPrimaryKey(); if (sm == null) return null; // look for a new object whose insert id is the same as this delete one Object oid = sm.getObjectId(); OpenJPAStateManager nsm = (OpenJPAStateManager) insertMap.get(oid); if (nsm == null) return null; // found new object; get its row row = rowMgr.getRow(row.getTable(), Row.ACTION_INSERT, nsm, false); return (row == null || row.isValid()) ? row : null; }
@Override public void insertBlobForStreamingLoad(Row row, Column col, JDBCStore store, Object ob, Select sel) throws SQLException { if (ob != null) { row.setBinaryStream(col, (InputStream)ob, -1); } else { row.setNull(col); } }
public Row getRow(Table table, int action, OpenJPAStateManager sm, boolean create) { while (sm != null && sm.getOwner() != null) sm = sm.getOwner(); if (_row != null && table == _row.getTable() && action == _row.getAction()) return _row; return new EmbeddedRow(_rm.getRow(table, action, sm, create)); }
insertMap = new HashMap((int) (inserts.size() * 1.33 + 1)); for (Iterator itr = inserts.iterator(); itr.hasNext();) { sm = ((Row) itr.next()).getPrimaryKey(); if (sm != null && sm.getObjectId() != null) insertMap.put(sm.getObjectId(), sm); if (row2 != null && row2.isValid() && row2 != row) graphs[1] = addEdge(graphs[1], (PrimaryRow) row2, row, fks[j]);