/* */ {
/* 94 */ lockedIterator = this.entity.getLockedIterator(ctx);
/* 95 */ while (lockedIterator.hasNext())
/* */ {
/* 97 */ sql.append(" AND ");
/* 98 */ JDBCCMPFieldBridge field = lockedIterator.next();
/* 99 */ if (field.getLockedValue(ctx) == null)
/* */ {
/* 101 */ SQLUtil.getIsNullClause(false, field, "", sql);
/* 102 */ lockedIterator.remove();
/* */ }
/* */ else
/* */ {
/* 106 */ SQLUtil.getWhereClause(field, sql);
/* */ }
/* */ }
/* */ }
/* */
/* 111 */ Connection con = null;
/* 112 */ PreparedStatement ps = null;
/* 113 */ int rowsAffected = 0;
/* */ try
/* */ {
/* 117 */ if (this.log.isDebugEnabled())
/* */ {
/* 119 */ this.log.debug("Executing SQL: " + sql);
/* */ }
/* */
/* 123 */ con = this.entity.getDataSource().getConnection();
/* 124 */ ps = con.prepareStatement(sql.toString());
/* */
/* 127 */ int index = 1;
/* 128 */ dirtyIterator.reset();
/* 129 */ while (dirtyIterator.hasNext())
/* */ {
/* 131 */ index = dirtyIterator.next().setInstanceParameters(ps, index, ctx);
/* */ }
/* */
/* 135 */ index = this.entity.setPrimaryKeyParameters(ps, index, ctx.getId());
/* */
/* 138 */ if (hasLockedFields)
/* */ {
/* 140 */ lockedIterator.reset();
/* 141 */ while (lockedIterator.hasNext())
/* */ {
/* 143 */ JDBCCMPFieldBridge field = lockedIterator.next();
/* 144 */ Object value = field.getLockedValue(ctx);
/* 145 */ index = field.setArgumentParameters(ps, index, value);
/* */ }
/* */
/* */ }
/* */
/* 150 */ rowsAffected = ps.executeUpdate();