public Map getBulkUpdateValues() { return vers.getClassMapping().getPCSuperclassMapping().getVersion() .getBulkUpdateValues(); } }
/** * Create version metadata for the given class. */ protected Version newVersion(ClassMapping cls) { return new Version(cls); }
public void afterLoad(OpenJPAStateManager sm, JDBCStore store) { vers.getClassMapping().getPCSuperclassMapping().getVersion(). afterLoad(sm, store); }
public void installStrategy(Version version) { version.clearMapping(); version.setStrategy(NoneVersionStrategy.getInstance(), null); }
public boolean checkVersion(OpenJPAStateManager sm, JDBCStore store, boolean updateVersion) throws SQLException { return vers.getClassMapping().getPCSuperclassMapping().getVersion(). checkVersion(sm, store, updateVersion); }
public void map(boolean adapt) { ClassMapping cls = vers.getClassMapping(); if (cls.getJoinablePCSuperclassMapping() != null || cls.getEmbeddingMetaData() != null) throw new MetaDataException(_loc.get("not-base-vers", cls)); vers.getMappingInfo().assertNoSchemaComponents(vers, true); }
public int compareVersion(Object v1, Object v2) { return vers.getClassMapping().getPCSuperclassMapping().getVersion(). compareVersion(v1, v2); }
public void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { assertStrategy().delete(sm, store, rm); }
/** * Parse @VersionColumn(s). */ private void parseVersionColumns(ClassMapping cm, VersionColumn... vcols) { if (vcols.length == 0) return; List<Column> cols = new ArrayList<Column>(vcols.length); for (VersionColumn vcol : vcols) cols.add(newColumn(vcol)); cm.getVersion().getMappingInfo().setColumns(cols); }
public boolean syncVersion(OpenJPAStateManager sm, Object context) { ClassMapping mapping = (ClassMapping) sm.getMetaData(); try { return mapping.getVersion().checkVersion(sm, this, true); } catch (SQLException se) { throw SQLExceptions.getStore(se, _dict); } }
/** * This method is to provide override for non-JDBC or JDBC-like * implementation of getting version from the result set. */ protected void getVersion(ClassMapping mapping, OpenJPAStateManager sm, Result res) throws SQLException { mapping.getVersion().afterLoad(sm, this); }
protected int getJavaType() { if (_javaType == null && vers.getClassMapping().getVersionFieldMapping() != null) { _javaType = Integer.valueOf(vers.getClassMapping().getVersionFieldMapping().getTypeCode()); } else { return JavaTypes.INT; } return _javaType; }
public int compareVersion(OpenJPAStateManager state, Object v1, Object v2) { ClassMapping mapping = (ClassMapping) state.getMetaData(); return mapping.getVersion().compareVersion(v1, v2); }
/** * Recursive method to delete the given instance, base class last. */ protected void delete(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, Collection customs) throws SQLException { Boolean custom = mapping.isCustomDelete(sm, store); if (!Boolean.FALSE.equals(custom)) mapping.customDelete(sm, store); if (Boolean.TRUE.equals(custom)) return; FieldMapping[] fields = mapping.getDefinedFieldMappings(); for (int i = 0; i < fields.length; i++) if (!bufferCustomDelete(fields[i], sm, store, customs)) fields[i].delete(sm, store, rowMgr); ClassMapping sup = mapping.getJoinablePCSuperclassMapping(); if (sup == null) { Version vers = mapping.getVersion(); if (!bufferCustomDelete(vers, sm, store, customs)) vers.delete(sm, store, rowMgr); Discriminator dsc = mapping.getDiscriminator(); if (!bufferCustomDelete(dsc, sm, store, customs)) dsc.delete(sm, store, rowMgr); } mapping.delete(sm, store, rowMgr); if (sup != null) delete(sm, sup, rowMgr, store, customs); }
FieldMapping fm = (FieldMapping) path.last(); ClassMapping meta = fm.getDeclaringMapping(); Map updates = meta.getVersion().getBulkUpdateValues(); for (Iterator iter = updates.entrySet().iterator(); iter.hasNext(); ) {
public void map(boolean adapt) { ClassMapping cls = vers.getClassMapping(); if (cls.getJoinablePCSuperclassMapping() != null || cls.getEmbeddingMetaData() != null) throw new MetaDataException(_loc.get("not-base-vers", cls)); vers.getMappingInfo().assertNoSchemaComponents(vers, true); }
public void installStrategy(Version version) { version.clearMapping(); version.setStrategy(NoneVersionStrategy.getInstance(), null); }
public boolean checkVersion(OpenJPAStateManager sm, JDBCStore store, boolean updateVersion) throws SQLException { return vers.getClassMapping().getPCSuperclassMapping().getVersion(). checkVersion(sm, store, updateVersion); }
public int compareVersion(Object v1, Object v2) { return vers.getClassMapping().getPCSuperclassMapping().getVersion(). compareVersion(v1, v2); }
public Object load(OpenJPAStateManager sm, JDBCStore store, Result res, Joins joins) throws SQLException { return assertStrategy().load(sm, store, res, joins); }