public void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { Column[] cols = vers.getColumns(); ColumnIO io = vers.getColumnIO(); Object initial = nextVersion(null); for (int i = 0; i < cols.length; i++) { Row row = rm.getRow(cols[i].getTable(), Row.ACTION_INSERT, sm, true); if (io.isInsertable(i, initial == null)) row.setObject(cols[i], getColumnValue(initial, i)); } // set initial version into state manager Object nextVersion; nextVersion = initial; sm.setNextVersion(nextVersion); }
public void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { Column[] cols = vers.getColumns(); ColumnIO io = vers.getColumnIO(); Object initial = nextVersion(null); for (int i = 0; i < cols.length; i++) { Row row = rm.getRow(cols[i].getTable(), Row.ACTION_INSERT, sm, true); if (io.isInsertable(i, initial == null)) row.setObject(cols[i], getColumnValue(initial, i)); } // set initial version into state manager Object nextVersion; nextVersion = initial; sm.setNextVersion(nextVersion); }
public void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { Column[] cols = vers.getColumns(); ColumnIO io = vers.getColumnIO(); Object initial = nextVersion(null); for (int i = 0; i < cols.length; i++) { Row row = rm.getRow(cols[i].getTable(), Row.ACTION_INSERT, sm, true); if (io.isInsertable(i, initial == null)) row.setObject(cols[i], getColumnValue(initial, i)); } // set initial version into state manager Object nextVersion; nextVersion = initial; sm.setNextVersion(nextVersion); }
public void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { Column[] cols = vers.getColumns(); ColumnIO io = vers.getColumnIO(); Object initial = nextVersion(null); for (int i = 0; i < cols.length; i++) { Row row = rm.getRow(cols[i].getTable(), Row.ACTION_INSERT, sm, true); if (io.isInsertable(i, initial == null)) row.setObject(cols[i], getColumnValue(initial, i)); } // set initial version into state manager Object nextVersion; nextVersion = initial; sm.setNextVersion(nextVersion); }
public void update(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { Column[] cols = vers.getColumns(); if (cols == null || cols.length == 0 || !sm.isDirty() && !sm.isVersionUpdateRequired()) return; Object curVersion = sm.getVersion(); Object nextVersion = nextVersion(curVersion); // set where and update conditions on row for (int i = 0; i < cols.length; i++) { Row row = rm.getRow(cols[i].getTable(), Row.ACTION_UPDATE, sm, true); row.setFailedObject(sm.getManagedInstance()); if (curVersion != null && sm.isVersionCheckRequired()) { row.whereObject(cols[i], getColumnValue(curVersion, i)); if (isSecondaryColumn(cols[i], sm)) { ForeignKey[] fks = cols[i].getTable().getForeignKeys(); for (ForeignKey fk : fks) { row.whereForeignKey(fk, sm); } } } if (vers.getColumnIO().isUpdatable(i, nextVersion == null)) row.setObject(cols[i], getColumnValue(nextVersion, i)); } if (nextVersion != null) sm.setNextVersion(nextVersion); }
public void update(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { Column[] cols = vers.getColumns(); if (cols == null || cols.length == 0 || !sm.isDirty() && !sm.isVersionUpdateRequired()) return; Object curVersion = sm.getVersion(); Object nextVersion = nextVersion(curVersion); // set where and update conditions on row for (int i = 0; i < cols.length; i++) { Row row = rm.getRow(cols[i].getTable(), Row.ACTION_UPDATE, sm, true); row.setFailedObject(sm.getManagedInstance()); if (curVersion != null && sm.isVersionCheckRequired()) { row.whereObject(cols[i], getColumnValue(curVersion, i)); if (isSecondaryColumn(cols[i], sm)) { ForeignKey[] fks = cols[i].getTable().getForeignKeys(); for (ForeignKey fk : fks) { row.whereForeignKey(fk, sm); } } } if (vers.getColumnIO().isUpdatable(i, nextVersion == null)) row.setObject(cols[i], getColumnValue(nextVersion, i)); } if (nextVersion != null) sm.setNextVersion(nextVersion); }
public void update(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { Column[] cols = vers.getColumns(); if (cols == null || cols.length == 0 || !sm.isDirty() && !sm.isVersionUpdateRequired()) return; Object curVersion = sm.getVersion(); Object nextVersion = nextVersion(curVersion); // set where and update conditions on row for (int i = 0; i < cols.length; i++) { Row row = rm.getRow(cols[i].getTable(), Row.ACTION_UPDATE, sm, true); row.setFailedObject(sm.getManagedInstance()); if (curVersion != null && sm.isVersionCheckRequired()) { row.whereObject(cols[i], getColumnValue(curVersion, i)); if (isSecondaryColumn(cols[i], sm)) { ForeignKey[] fks = cols[i].getTable().getForeignKeys(); for (ForeignKey fk : fks) { row.whereForeignKey(fk, sm); } } } if (vers.getColumnIO().isUpdatable(i, nextVersion == null)) row.setObject(cols[i], getColumnValue(nextVersion, i)); } if (nextVersion != null) sm.setNextVersion(nextVersion); }
public void update(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { Column[] cols = vers.getColumns(); if (cols == null || cols.length == 0 || !sm.isDirty() && !sm.isVersionUpdateRequired()) return; Object curVersion = sm.getVersion(); Object nextVersion = nextVersion(curVersion); // set where and update conditions on row for (int i = 0; i < cols.length; i++) { Row row = rm.getRow(cols[i].getTable(), Row.ACTION_UPDATE, sm, true); row.setFailedObject(sm.getManagedInstance()); if (curVersion != null && sm.isVersionCheckRequired()) { row.whereObject(cols[i], getColumnValue(curVersion, i)); if (isSecondaryColumn(cols[i], sm)) { ForeignKey[] fks = cols[i].getTable().getForeignKeys(); for (ForeignKey fk : fks) { row.whereForeignKey(fk, sm); } } } if (vers.getColumnIO().isUpdatable(i, nextVersion == null)) row.setObject(cols[i], getColumnValue(nextVersion, i)); } if (nextVersion != null) sm.setNextVersion(nextVersion); }
public void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { Column[] cols = vers.getColumns(); Object curVersion = sm.getVersion(); Object cur; for (int i = 0; i < cols.length; i++) { Row row = rm.getRow(cols[i].getTable(), Row.ACTION_DELETE, sm, true); row.setFailedObject(sm.getManagedInstance()); cur = getColumnValue(curVersion, i); // set where and update conditions on row if (cur != null) { row.whereObject(cols[i], cur); if (isSecondaryColumn(cols[i], sm)) { ForeignKey[] fks = cols[i].getTable().getForeignKeys(); for (ForeignKey fk : fks) { row.whereForeignKey(fk, sm); } } } } }
public void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { Column[] cols = vers.getColumns(); Object curVersion = sm.getVersion(); Object cur; for (int i = 0; i < cols.length; i++) { Row row = rm.getRow(cols[i].getTable(), Row.ACTION_DELETE, sm, true); row.setFailedObject(sm.getManagedInstance()); cur = getColumnValue(curVersion, i); // set where and update conditions on row if (cur != null) { row.whereObject(cols[i], cur); if (isSecondaryColumn(cols[i], sm)) { ForeignKey[] fks = cols[i].getTable().getForeignKeys(); for (ForeignKey fk : fks) { row.whereForeignKey(fk, sm); } } } } }
public void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { Column[] cols = vers.getColumns(); Object curVersion = sm.getVersion(); Object cur; for (int i = 0; i < cols.length; i++) { Row row = rm.getRow(cols[i].getTable(), Row.ACTION_DELETE, sm, true); row.setFailedObject(sm.getManagedInstance()); cur = getColumnValue(curVersion, i); // set where and update conditions on row if (cur != null) { row.whereObject(cols[i], cur); if (isSecondaryColumn(cols[i], sm)) { ForeignKey[] fks = cols[i].getTable().getForeignKeys(); for (ForeignKey fk : fks) { row.whereForeignKey(fk, sm); } } } } }
public void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { Column[] cols = vers.getColumns(); Object curVersion = sm.getVersion(); Object cur; for (int i = 0; i < cols.length; i++) { Row row = rm.getRow(cols[i].getTable(), Row.ACTION_DELETE, sm, true); row.setFailedObject(sm.getManagedInstance()); cur = getColumnValue(curVersion, i); // set where and update conditions on row if (cur != null) { row.whereObject(cols[i], cur); if (isSecondaryColumn(cols[i], sm)) { ForeignKey[] fks = cols[i].getTable().getForeignKeys(); for (ForeignKey fk : fks) { row.whereForeignKey(fk, sm); } } } } }