removeQuery.setModifyRow(modifyRow); removeQuery.setHasModifyRow(true); removeQuery.setIsExecutionClone(true);
removeQuery.setModifyRow(modifyRow); removeQuery.setHasModifyRow(true); removeQuery.setIsExecutionClone(true);
removeQuery.setModifyRow(modifyRow); removeQuery.setHasModifyRow(true); removeQuery.setIsExecutionClone(true);
getInsertQuery().setModifyRow(joinRow);
removeQuery.setModifyRow(modifyRow); removeQuery.setHasModifyRow(true); removeQuery.setIsExecutionClone(true);
removeQuery.setModifyRow(modifyRow); removeQuery.setHasModifyRow(true); removeQuery.setIsExecutionClone(true);
/** * Initialize insert query. This query is used to insert the collection of objects into the * reference table. */ protected void initializeInsertQuery(AbstractSession session) { if (!getInsertQuery().hasSessionName()) { getInsertQuery().setSessionName(session.getName()); } if (hasCustomInsertQuery()) { return; } SQLInsertStatement statement = new SQLInsertStatement(); statement.setTable(getReferenceTable()); AbstractRecord directRow = new DatabaseRecord(); for (Enumeration referenceEnum = getReferenceKeyFields().elements(); referenceEnum.hasMoreElements();) { directRow.put((DatabaseField)referenceEnum.nextElement(), null); } directRow.put(getDirectField(), null); if(listOrderField != null) { directRow.put(listOrderField, null); } statement.setModifyRow(directRow); getInsertQuery().setSQLStatement(statement); getInsertQuery().setModifyRow(directRow); }
/** * Initialize insert query. This query is used to insert the collection of objects into the * reference table. */ protected void initializeInsertQuery(AbstractSession session) { if (!getInsertQuery().hasSessionName()) { getInsertQuery().setSessionName(session.getName()); } if (getInsertQuery().getPartitioningPolicy() == null) { getInsertQuery().setPartitioningPolicy(getPartitioningPolicy()); } if (hasCustomInsertQuery()) { return; } SQLInsertStatement statement = new SQLInsertStatement(); statement.setTable(getReferenceTable()); AbstractRecord directRow = new DatabaseRecord(); for (Enumeration referenceEnum = getReferenceKeyFields().elements(); referenceEnum.hasMoreElements();) { directRow.put((DatabaseField)referenceEnum.nextElement(), null); } directRow.put(getDirectField(), null); if(listOrderField != null) { directRow.put(listOrderField, null); } statement.setModifyRow(directRow); getInsertQuery().setSQLStatement(statement); getInsertQuery().setModifyRow(directRow); }
/** * Initialize insert query. This query is used to insert the collection of objects into the * reference table. */ protected void initializeInsertQuery(AbstractSession session) { if (!getInsertQuery().hasSessionName()) { getInsertQuery().setSessionName(session.getName()); } if (getInsertQuery().getPartitioningPolicy() == null) { getInsertQuery().setPartitioningPolicy(getPartitioningPolicy()); } if (hasCustomInsertQuery()) { return; } SQLInsertStatement statement = new SQLInsertStatement(); statement.setTable(getReferenceTable()); AbstractRecord directRow = new DatabaseRecord(); for (Enumeration referenceEnum = getReferenceKeyFields().elements(); referenceEnum.hasMoreElements();) { directRow.put((DatabaseField)referenceEnum.nextElement(), null); } directRow.put(getDirectField(), null); if(listOrderField != null) { directRow.put(listOrderField, null); } statement.setModifyRow(directRow); getInsertQuery().setSQLStatement(statement); getInsertQuery().setModifyRow(directRow); }
/** * INTERNAL: * Performs a logical insert into the historical schema. Direct * collections and many to many mappings are maintained through the session * events. */ public void mappingLogicalInsert(DataModifyQuery originalQuery, AbstractRecord arguments, AbstractSession session) { DataModifyQuery historyQuery = new DataModifyQuery(); SQLInsertStatement historyStatement = new SQLInsertStatement(); DatabaseTable histTable = getHistoricalTables().get(0); historyStatement.setTable(histTable); AbstractRecord modifyRow = originalQuery.getModifyRow().clone(); AbstractRecord translationRow = arguments.clone(); // Start could be the version field in timestamp locking. if (!modifyRow.containsKey(getStart())) { Object time = getCurrentTime(session); modifyRow.add(getStart(), time); translationRow.add(getStart(), time); } historyQuery.setSQLStatement(historyStatement); historyQuery.setModifyRow(modifyRow); historyStatement.setModifyRow(modifyRow); session.executeQuery(historyQuery, translationRow); }
/** * INTERNAL: * Performs a logical insert into the historical schema. Direct * collections and many to many mappings are maintained through the session * events. */ public void mappingLogicalInsert(DataModifyQuery originalQuery, AbstractRecord arguments, AbstractSession session) { DataModifyQuery historyQuery = new DataModifyQuery(); SQLInsertStatement historyStatement = new SQLInsertStatement(); DatabaseTable histTable = getHistoricalTables().get(0); historyStatement.setTable(histTable); AbstractRecord modifyRow = originalQuery.getModifyRow().clone(); AbstractRecord translationRow = arguments.clone(); // Start could be the version field in timestamp locking. if (!modifyRow.containsKey(getStart())) { Object time = getCurrentTime(session); modifyRow.add(getStart(), time); translationRow.add(getStart(), time); } historyQuery.setSQLStatement(historyStatement); historyQuery.setModifyRow(modifyRow); historyStatement.setModifyRow(modifyRow); session.executeQuery(historyQuery, translationRow); }
/** * INTERNAL: * Performs a logical insert into the historical schema. Direct * collections and many to many mappings are maintained through the session * events. */ public void mappingLogicalInsert(DataModifyQuery originalQuery, AbstractRecord arguments, AbstractSession session) { DataModifyQuery historyQuery = new DataModifyQuery(); SQLInsertStatement historyStatement = new SQLInsertStatement(); DatabaseTable histTable = (DatabaseTable)getHistoricalTables().elementAt(0); historyStatement.setTable(histTable); AbstractRecord modifyRow = (AbstractRecord)originalQuery.getModifyRow().clone(); AbstractRecord translationRow = (AbstractRecord)arguments.clone(); // Start could be the version field in timestamp locking. if (!modifyRow.containsKey(getStart())) { Object time = getCurrentTime(session); modifyRow.add(getStart(), time); translationRow.add(getStart(), time); } historyQuery.setSQLStatement(historyStatement); historyQuery.setModifyRow(modifyRow); historyStatement.setModifyRow(modifyRow); session.executeQuery(historyQuery, translationRow); }
/** * INTERNAL: * Performs a logical delete (update) on the historical schema. Direct * collections and many to many mappings are maintained through the session * events. */ public void mappingLogicalDelete(ModifyQuery originalQuery, AbstractRecord arguments, AbstractSession session) { SQLDeleteStatement originalStatement = (SQLDeleteStatement)originalQuery.getSQLStatement(); DataModifyQuery historyQuery = new DataModifyQuery(); SQLUpdateStatement historyStatement = new SQLUpdateStatement(); DatabaseTable histTable = getHistoricalTables().get(0); historyStatement.setTable(histTable); Expression whereClause = (Expression)originalStatement.getWhereClause().clone(); DatabaseField endField = getEnd(); whereClause = whereClause.getBuilder().getField(endField).isNull().and(whereClause); historyStatement.setWhereClause(whereClause); AbstractRecord modifyRow = new DatabaseRecord(); AbstractRecord translationRow = arguments.clone(); Object time = getCurrentTime(session); modifyRow.add(getEnd(), time); translationRow.add(getEnd(), time); historyStatement.setModifyRow(modifyRow); historyQuery.setSQLStatement(historyStatement); historyQuery.setModifyRow(modifyRow); session.executeQuery(historyQuery, translationRow); } }
/** * INTERNAL: * Performs a logical delete (update) on the historical schema. Direct * collections and many to many mappings are maintained through the session * events. */ public void mappingLogicalDelete(ModifyQuery originalQuery, AbstractRecord arguments, AbstractSession session) { SQLDeleteStatement originalStatement = (SQLDeleteStatement)originalQuery.getSQLStatement(); DataModifyQuery historyQuery = new DataModifyQuery(); SQLUpdateStatement historyStatement = new SQLUpdateStatement(); DatabaseTable histTable = getHistoricalTables().get(0); historyStatement.setTable(histTable); Expression whereClause = (Expression)originalStatement.getWhereClause().clone(); DatabaseField endField = getEnd(); whereClause = whereClause.getBuilder().getField(endField).isNull().and(whereClause); historyStatement.setWhereClause(whereClause); AbstractRecord modifyRow = new DatabaseRecord(); AbstractRecord translationRow = arguments.clone(); Object time = getCurrentTime(session); modifyRow.add(getEnd(), time); translationRow.add(getEnd(), time); historyStatement.setModifyRow(modifyRow); historyQuery.setSQLStatement(historyStatement); historyQuery.setModifyRow(modifyRow); session.executeQuery(historyQuery, translationRow); } }
/** * INTERNAL: * Performs a logical delete (update) on the historical schema. Direct * collections and many to many mappings are maintained through the session * events. */ public void mappingLogicalDelete(ModifyQuery originalQuery, AbstractRecord arguments, AbstractSession session) { SQLDeleteStatement originalStatement = (SQLDeleteStatement)originalQuery.getSQLStatement(); DataModifyQuery historyQuery = new DataModifyQuery(); SQLUpdateStatement historyStatement = new SQLUpdateStatement(); DatabaseTable histTable = (DatabaseTable)getHistoricalTables().elementAt(0); historyStatement.setTable(histTable); Expression whereClause = (Expression)originalStatement.getWhereClause().clone(); DatabaseField endField = getEnd(); whereClause = whereClause.getBuilder().getField(endField).isNull().and(whereClause); historyStatement.setWhereClause(whereClause); AbstractRecord modifyRow = new DatabaseRecord(); AbstractRecord translationRow = (AbstractRecord)arguments.clone(); Object time = getCurrentTime(session); modifyRow.add(getEnd(), time); translationRow.add(getEnd(), time); historyStatement.setModifyRow(modifyRow); historyQuery.setSQLStatement(historyStatement); historyQuery.setModifyRow(modifyRow); session.executeQuery(historyQuery, translationRow); } }
} else if (event[0] == UpdateAtIndex) { DataModifyQuery updateAtIndexQuery = (DataModifyQuery)((DataModifyQuery)event[1]).clone(); updateAtIndexQuery.setModifyRow((AbstractRecord)event[3]); updateAtIndexQuery.setHasModifyRow(true); updateAtIndexQuery.setIsExecutionClone(true);
} else if (event[0] == UpdateAtIndex) { DataModifyQuery updateAtIndexQuery = (DataModifyQuery)((DataModifyQuery)event[1]).clone(); updateAtIndexQuery.setModifyRow((AbstractRecord)event[3]); updateAtIndexQuery.setHasModifyRow(true); updateAtIndexQuery.setIsExecutionClone(true);
} else if (event[0] == UpdateAtIndex) { DataModifyQuery updateAtIndexQuery = (DataModifyQuery)((DataModifyQuery)event[1]).clone(); updateAtIndexQuery.setModifyRow((AbstractRecord)event[3]); updateAtIndexQuery.setHasModifyRow(true); updateAtIndexQuery.setIsExecutionClone(true);
getInsertQuery().setModifyRow(joinRow);
getInsertQuery().setModifyRow(joinRow);