protected void assertNotMappedBy() { if (field != null && field.getMappedBy() != null) throw new UnsupportedOperationException(); }
private void insert(OpenJPAStateManager sm, RowManager rm, Object vals) throws SQLException { if (field.getMappedBy() != null && !_orderInsert && !_orderUpdate) return; Collection coll = toCollection(vals); if (coll == null || coll.isEmpty()) return; ClassMapping rel = field.getElementMapping().getTypeMapping(); int idx = 0; for (Iterator itr = coll.iterator(); itr.hasNext(); idx++) updateInverse(sm.getContext(), itr.next(), rel, rm, sm, idx); }
private void insert(OpenJPAStateManager sm, RowManager rm, Object vals) throws SQLException { if (field.getMappedBy() != null && !_orderInsert && !_orderUpdate) return; Collection coll = toCollection(vals); if (coll == null || coll.isEmpty()) return; ClassMapping rel = field.getElementMapping().getTypeMapping(); int idx = 0; for (Iterator itr = coll.iterator(); itr.hasNext(); idx++) updateInverse(sm.getContext(), itr.next(), rel, rm, sm, idx); }
private void insert(OpenJPAStateManager sm, RowManager rm, Object vals) throws SQLException { if (field.getMappedBy() != null && !_orderInsert && !_orderUpdate) return; Collection coll = toCollection(vals); if (coll == null || coll.isEmpty()) return; ClassMapping rel = field.getElementMapping().getTypeMapping(); int idx = 0; for (Iterator itr = coll.iterator(); itr.hasNext(); idx++) updateInverse(sm.getContext(), itr.next(), rel, rm, sm, idx); }
public void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { if (field.getMappedBy() == null || _orderInsert || _orderUpdate) insert(sm, rm, sm.fetchObject(field.getIndex())); }
/** * Throws an informative exception if the field declares a mapped-by value. */ protected void assertNotMappedBy() { if (field != null && field.getMappedBy() != null) throw new MetaDataException(_loc.get("cant-mapped-by", field, getAlias())); }
public void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { if (field.getMappedBy() == null || _orderInsert || _orderUpdate) insert(sm, rm, sm.fetchObject(field.getIndex())); }
/** * Throws an informative exception if the field declares a mapped-by value. */ protected void assertNotMappedBy() { if (field != null && field.getMappedBy() != null) throw new MetaDataException(_loc.get("cant-mapped-by", field, getAlias())); }
public void insert(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { if (field.getMappedBy() == null || field.isBiMTo1JT()) insert(sm, rm, sm.fetchObject(field.getIndex())); }
public void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { if ((field.getMappedBy() != null && !field.isBiMTo1JT())) return; if (field.isUni1ToMFK()) { Map mapObj = (Map)sm.fetchObject(field.getIndex()); updateSetNull(sm, store, rm, mapObj.keySet()); return; } super.delete(sm, store, rm); }
public void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { if ((field.getMappedBy() != null && !field.isBiMTo1JT())) return; if (field.isUni1ToMFK()) { Map mapObj = (Map)sm.fetchObject(field.getIndex()); updateSetNull(sm, store, rm, mapObj.keySet()); return; } super.delete(sm, store, rm); }
public void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { if ((field.getMappedBy() != null && !field.isBiMTo1JT())) return; if (field.isUni1ToMFK()) { Map mapObj = (Map)sm.fetchObject(field.getIndex()); updateSetNull(sm, store, rm, mapObj.keySet()); return; } super.delete(sm, store, rm); }
public void delete(OpenJPAStateManager sm, JDBCStore store, RowManager rm) throws SQLException { if ((field.getMappedBy() != null && !field.isBiMTo1JT())) return; if (field.isUni1ToMFK()) { Map mapObj = (Map)sm.fetchObject(field.getIndex()); updateSetNull(sm, store, rm, mapObj.keySet()); return; } super.delete(sm, store, rm); }
/** * Copy mapping info from the given instance to this one. */ public void copyMappingInfo(FieldMapping fm) { setMappedBy(fm.getMappedBy()); _info.copy(fm.getMappingInfo()); _val.copyMappingInfo(fm.getValueMapping()); _key.copyMappingInfo(fm.getKeyMapping()); _elem.copyMappingInfo(fm.getElementMapping()); }
/** * Copy mapping info from the given instance to this one. */ public void copyMappingInfo(FieldMapping fm) { setMappedBy(fm.getMappedBy()); _info.copy(fm.getMappingInfo()); _val.copyMappingInfo(fm.getValueMapping()); _key.copyMappingInfo(fm.getKeyMapping()); _elem.copyMappingInfo(fm.getElementMapping()); }
/** * Copy mapping info from the given instance to this one. */ public void copyMappingInfo(FieldMapping fm) { setMappedBy(fm.getMappedBy()); _info.copy(fm.getMappingInfo()); _val.copyMappingInfo(fm.getValueMapping()); _key.copyMappingInfo(fm.getKeyMapping()); _elem.copyMappingInfo(fm.getElementMapping()); }
/** * Copy mapping info from the given instance to this one. */ public void copyMappingInfo(FieldMapping fm) { setMappedBy(fm.getMappedBy()); _info.copy(fm.getMappingInfo()); _val.copyMappingInfo(fm.getValueMapping()); _key.copyMappingInfo(fm.getKeyMapping()); _elem.copyMappingInfo(fm.getElementMapping()); }
public void initialize() { Column order = field.getOrderColumn(); _orderInsert = field.getOrderColumnIO().isInsertable(order, false); _orderUpdate = field.getOrderColumnIO().isUpdatable(order, false); ValueMapping elem = field.getElementMapping(); Log log = field.getRepository().getLog(); if (field.getMappedBy() == null && elem.getUseClassCriteria() && log.isWarnEnabled()) { ForeignKey fk = elem.getForeignKey(); if (elem.getColumnIO().isAnyUpdatable(fk, false)) log.warn(_loc.get("class-crit-owner", field)); } }
public void initialize() { Column order = field.getOrderColumn(); _orderInsert = field.getOrderColumnIO().isInsertable(order, false); _orderUpdate = field.getOrderColumnIO().isUpdatable(order, false); ValueMapping elem = field.getElementMapping(); Log log = field.getRepository().getLog(); if (field.getMappedBy() == null && elem.getUseClassCriteria() && log.isWarnEnabled()) { ForeignKey fk = elem.getForeignKey(); if (elem.getColumnIO().isAnyUpdatable(fk, false)) log.warn(_loc.get("class-crit-owner", field)); } }
public void initialize() { Column order = field.getOrderColumn(); _orderInsert = field.getOrderColumnIO().isInsertable(order, false); _orderUpdate = field.getOrderColumnIO().isUpdatable(order, false); ValueMapping elem = field.getElementMapping(); Log log = field.getRepository().getLog(); if (field.getMappedBy() == null && elem.getUseClassCriteria() && log.isWarnEnabled()) { ForeignKey fk = elem.getForeignKey(); if (elem.getColumnIO().isAnyUpdatable(fk, false)) log.warn(_loc.get("class-crit-owner", field)); } }