/** * Update version and discriminator indicators. */ protected void updateIndicators(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, Collection customs, boolean versionUpdateOnly) throws SQLException { while (mapping.getJoinablePCSuperclassMapping() != null) mapping = mapping.getJoinablePCSuperclassMapping(); Version vers = mapping.getVersion(); if (!bufferCustomUpdate(vers, sm, store, customs)) vers.update(sm, store, rowMgr); if (versionUpdateOnly) { // if we are only updating the version column, we need to add // in the primary key select mapping.update(sm, store, rowMgr); } else { // otherwise we need to make sure we update the discriminator too Discriminator dsc = mapping.getDiscriminator(); if (!bufferCustomUpdate(dsc, sm, store, customs)) dsc.update(sm, store, rowMgr); } }
/** * Update version and discriminator indicators. */ protected void updateIndicators(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, Collection customs, boolean versionUpdateOnly) throws SQLException { while (mapping.getJoinablePCSuperclassMapping() != null) mapping = mapping.getJoinablePCSuperclassMapping(); Version vers = mapping.getVersion(); if (!bufferCustomUpdate(vers, sm, store, customs)) vers.update(sm, store, rowMgr); if (versionUpdateOnly) { // if we are only updating the version column, we need to add // in the primary key select mapping.update(sm, store, rowMgr); } else { // otherwise we need to make sure we update the discriminator too Discriminator dsc = mapping.getDiscriminator(); if (!bufferCustomUpdate(dsc, sm, store, customs)) dsc.update(sm, store, rowMgr); } }
/** * Update version and discriminator indicators. */ protected void updateIndicators(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, Collection customs, boolean versionUpdateOnly) throws SQLException { while (mapping.getJoinablePCSuperclassMapping() != null) mapping = mapping.getJoinablePCSuperclassMapping(); Version vers = mapping.getVersion(); if (!bufferCustomUpdate(vers, sm, store, customs)) vers.update(sm, store, rowMgr); if (versionUpdateOnly) { // if we are only updating the version column, we need to add // in the primary key select mapping.update(sm, store, rowMgr); } else { // otherwise we need to make sure we update the discriminator too Discriminator dsc = mapping.getDiscriminator(); if (!bufferCustomUpdate(dsc, sm, store, customs)) dsc.update(sm, store, rowMgr); } }
/** * Update version and discriminator indicators. */ protected void updateIndicators(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, Collection customs, boolean versionUpdateOnly) throws SQLException { while (mapping.getJoinablePCSuperclassMapping() != null) mapping = mapping.getJoinablePCSuperclassMapping(); Version vers = mapping.getVersion(); if (!bufferCustomUpdate(vers, sm, store, customs)) vers.update(sm, store, rowMgr); if (versionUpdateOnly) { // if we are only updating the version column, we need to add // in the primary key select mapping.update(sm, store, rowMgr); } else { // otherwise we need to make sure we update the discriminator too Discriminator dsc = mapping.getDiscriminator(); if (!bufferCustomUpdate(dsc, sm, store, customs)) dsc.update(sm, store, rowMgr); } }
/** * Update version and discriminator indicators. */ protected void updateIndicators(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, Collection customs, boolean versionUpdateOnly) throws SQLException { while (mapping.getJoinablePCSuperclassMapping() != null) mapping = mapping.getJoinablePCSuperclassMapping(); Version vers = mapping.getVersion(); if (!bufferCustomUpdate(vers, sm, store, customs)) vers.update(sm, store, rowMgr); if (versionUpdateOnly) { // if we are only updating the version column, we need to add // in the primary key select mapping.update(sm, store, rowMgr); } else { // otherwise we need to make sure we update the discriminator too Discriminator dsc = mapping.getDiscriminator(); if (!bufferCustomUpdate(dsc, sm, store, customs)) dsc.update(sm, store, rowMgr); } }
/** * Recursive method to update the given instance. */ protected void update(OpenJPAStateManager sm, BitSet dirty, ClassMapping mapping, RowManager rowMgr, JDBCStore store, Collection customs) throws SQLException { Boolean custom = mapping.isCustomUpdate(sm, store); if (!Boolean.FALSE.equals(custom)) mapping.customUpdate(sm, store); if (Boolean.TRUE.equals(custom)) return; // update all fields before all mappings so that the mappings can // detect whether any fields in their rows have been modified FieldMapping[] fields = mapping.getDefinedFieldMappings(); for (int i = 0; i < fields.length; i++) { if (dirty.get(fields[i].getIndex()) && !bufferCustomUpdate(fields[i], sm, store, customs)) fields[i].update(sm, store, rowMgr); } ClassMapping sup = mapping.getJoinablePCSuperclassMapping(); if (sup == null) updateIndicators(sm, mapping, rowMgr, store, customs, false); else update(sm, dirty, sup, rowMgr, store, customs); mapping.update(sm, store, rowMgr); }
FieldMapping field = fields[i]; if (dirty.get(field.getIndex()) && !bufferCustomUpdate(field, sm, store, customs)) { field.update(sm, store, rowMgr); if (!updateIndicators) {
FieldMapping field = fields[i]; if (dirty.get(field.getIndex()) && !bufferCustomUpdate(field, sm, store, customs)) { field.update(sm, store, rowMgr); if (!updateIndicators) {
FieldMapping field = fields[i]; if (dirty.get(field.getIndex()) && !bufferCustomUpdate(field, sm, store, customs)) { field.update(sm, store, rowMgr); if (!updateIndicators) {
FieldMapping field = fields[i]; if (dirty.get(field.getIndex()) && !bufferCustomUpdate(field, sm, store, customs)) { field.update(sm, store, rowMgr); if (!updateIndicators) {