protected DataModifyQuery getDeleteQuery() { return this.mechanism.getDeleteQuery(); }
protected DataModifyQuery getDeleteQuery() { return this.mechanism.getDeleteQuery(); }
protected DataModifyQuery getDeleteQuery() { return this.mechanism.getDeleteQuery(); }
/** * PUBLIC: * Set the name of the session to execute the mapping's queries under. * This can be used by the session broker to override the default session * to be used for the target class. */ public void setSessionName(String name) { getInsertQuery().setSessionName(name); getDeleteQuery().setSessionName(name); }
/** * PUBLIC: * Set the name of the session to execute the mapping's queries under. * This can be used by the session broker to override the default session * to be used for the target class. */ public void setSessionName(String name) { getInsertQuery().setSessionName(name); getDeleteQuery().setSessionName(name); }
/** * PUBLIC: * Set the name of the session to execute the mapping's queries under. * This can be used by the session broker to override the default session * to be used for the target class. */ public void setSessionName(String name) { getInsertQuery().setSessionName(name); getDeleteQuery().setSessionName(name); }
if (!getDeleteQuery().hasSessionName()) { getDeleteQuery().setSessionName(session.getName()); statement.setTable(getRelationTable()); statement.setWhereClause(whereClause); getDeleteQuery().setSQLStatement(statement);
/** * INTERNAL: * An object was removed to the collection during an update, delete it if private. */ protected void objectRemovedDuringUpdate(ObjectLevelModifyQuery query, Object objectDeleted, Map extraData) throws DatabaseException, OptimisticLockException { Object unwrappedObjectDeleted = getContainerPolicy().unwrapIteratorResult(objectDeleted); AbstractRecord databaseRow = this.mechanism.buildRelationTableSourceAndTargetRow(query.getTranslationRow(), unwrappedObjectDeleted, query.getSession(), this); // In the uow data queries are cached until the end of the commit. if (query.shouldCascadeOnlyDependentParts()) { // Hey I might actually want to use an inner class here... ok array for now. Object[] event = new Object[3]; event[0] = ObjectRemoved; event[1] = this.mechanism.getDeleteQuery(); event[2] = databaseRow; query.getSession().getCommitManager().addDataModificationEvent(this, event); } else { query.getSession().executeQuery(this.mechanism.getDeleteQuery(), databaseRow); if ((getHistoryPolicy() != null) && getHistoryPolicy().shouldHandleWrites()) { getHistoryPolicy().mappingLogicalDelete(this.mechanism.getDeleteQuery(), databaseRow, query.getSession()); } } // Delete object after join entry is delete if private. super.objectRemovedDuringUpdate(query, objectDeleted, extraData); }
/** * INTERNAL: * An object was removed to the collection during an update, delete it if private. */ @Override protected void objectRemovedDuringUpdate(ObjectLevelModifyQuery query, Object objectDeleted, Map extraData) throws DatabaseException, OptimisticLockException { Object unwrappedObjectDeleted = getContainerPolicy().unwrapIteratorResult(objectDeleted); AbstractRecord databaseRow = this.mechanism.buildRelationTableSourceAndTargetRow(query.getTranslationRow(), unwrappedObjectDeleted, query.getSession(), this); // In the uow data queries are cached until the end of the commit. if (query.shouldCascadeOnlyDependentParts()) { // Hey I might actually want to use an inner class here... ok array for now. Object[] event = new Object[3]; event[0] = ObjectRemoved; event[1] = this.mechanism.getDeleteQuery(); event[2] = databaseRow; query.getSession().getCommitManager().addDataModificationEvent(this, event); } else { query.getSession().executeQuery(this.mechanism.getDeleteQuery(), databaseRow); if ((getHistoryPolicy() != null) && getHistoryPolicy().shouldHandleWrites()) { getHistoryPolicy().mappingLogicalDelete(this.mechanism.getDeleteQuery(), databaseRow, query.getSession()); } } // Delete object after join entry is delete if private. super.objectRemovedDuringUpdate(query, objectDeleted, extraData); }
/** * INTERNAL: * An object was removed to the collection during an update, delete it if private. */ @Override protected void objectRemovedDuringUpdate(ObjectLevelModifyQuery query, Object objectDeleted, Map extraData) throws DatabaseException, OptimisticLockException { Object unwrappedObjectDeleted = getContainerPolicy().unwrapIteratorResult(objectDeleted); AbstractRecord databaseRow = this.mechanism.buildRelationTableSourceAndTargetRow(query.getTranslationRow(), unwrappedObjectDeleted, query.getSession(), this); // In the uow data queries are cached until the end of the commit. if (query.shouldCascadeOnlyDependentParts()) { // Hey I might actually want to use an inner class here... ok array for now. Object[] event = new Object[3]; event[0] = ObjectRemoved; event[1] = this.mechanism.getDeleteQuery(); event[2] = databaseRow; query.getSession().getCommitManager().addDataModificationEvent(this, event); } else { query.getSession().executeQuery(this.mechanism.getDeleteQuery(), databaseRow); if ((getHistoryPolicy() != null) && getHistoryPolicy().shouldHandleWrites()) { getHistoryPolicy().mappingLogicalDelete(this.mechanism.getDeleteQuery(), databaseRow, query.getSession()); } } // Delete object after join entry is delete if private. super.objectRemovedDuringUpdate(query, objectDeleted, extraData); }
if (!getDeleteQuery().hasSessionName()) { getDeleteQuery().setSessionName(session.getName()); if (getDeleteQuery().getPartitioningPolicy() == null) { getDeleteQuery().setPartitioningPolicy(mapping.getPartitioningPolicy()); statement.setTable(getRelationTable()); statement.setWhereClause(whereClause); getDeleteQuery().setSQLStatement(statement);
if (!getDeleteQuery().hasSessionName()) { getDeleteQuery().setSessionName(session.getName()); if (getDeleteQuery().getPartitioningPolicy() == null) { getDeleteQuery().setPartitioningPolicy(mapping.getPartitioningPolicy()); statement.setTable(getRelationTable()); statement.setWhereClause(whereClause); getDeleteQuery().setSQLStatement(statement);