/** * Return a boolean SQL expression that should be added to the * WHERE clause of an UPDATE to test whether the current database * record matches our stored version. */ public String getSQL() { Column[] cols = getTable().getColumns(); StringBuffer buf = new StringBuffer(); boolean hasWhere = false; Object val; for (int i = 0; i < cols.length; i++) { val = getWhere(cols[i]); if (val == null) continue; if (hasWhere) buf.append(" AND "); if (val == NULL) buf.append(cols[i]).append(" IS NULL"); else buf.append(cols[i]).append(" = ?"); hasWhere = true; } return buf.toString(); }
/** * Return a boolean SQL expression that should be added to the * WHERE clause of an UPDATE to test whether the current database * record matches our stored version. */ public String getSQL(DBDictionary dict) { Column[] cols = getTable().getColumns(); StringBuilder buf = new StringBuilder(); boolean hasWhere = false; Object val; for (int i = 0; i < cols.length; i++) { val = getWhere(cols[i]); if (val == null) continue; if (hasWhere) buf.append(" AND "); if (val == NULL) buf.append(dict.getColumnDBName(cols[i]) + " IS NULL"); else buf.append(dict.getColumnDBName(cols[i]) + " = ?"); hasWhere = true; } return buf.toString(); }
/** * Return a boolean SQL expression that should be added to the * WHERE clause of an UPDATE to test whether the current database * record matches our stored version. */ public String getSQL(DBDictionary dict) { Column[] cols = getTable().getColumns(); StringBuilder buf = new StringBuilder(); boolean hasWhere = false; Object val; for (int i = 0; i < cols.length; i++) { val = getWhere(cols[i]); if (val == null) continue; if (hasWhere) buf.append(" AND "); if (val == NULL) buf.append(dict.getColumnDBName(cols[i]) + " IS NULL"); else buf.append(dict.getColumnDBName(cols[i]) + " = ?"); hasWhere = true; } return buf.toString(); }
/** * Return a boolean SQL expression that should be added to the * WHERE clause of an UPDATE to test whether the current database * record matches our stored version. */ public String getSQL(DBDictionary dict) { Column[] cols = getTable().getColumns(); StringBuilder buf = new StringBuilder(); boolean hasWhere = false; Object val; for (int i = 0; i < cols.length; i++) { val = getWhere(cols[i]); if (val == null) continue; if (hasWhere) buf.append(" AND "); if (val == NULL) buf.append(dict.getColumnDBName(cols[i]) + " IS NULL"); else buf.append(dict.getColumnDBName(cols[i]) + " = ?"); hasWhere = true; } return buf.toString(); }
/** * Return a boolean SQL expression that should be added to the * WHERE clause of an UPDATE to test whether the current database * record matches our stored version. */ public String getSQL(DBDictionary dict) { Column[] cols = getTable().getColumns(); StringBuilder buf = new StringBuilder(); boolean hasWhere = false; Object val; for (int i = 0; i < cols.length; i++) { val = getWhere(cols[i]); if (val == null) continue; if (hasWhere) buf.append(" AND "); if (val == NULL) buf.append(dict.getColumnDBName(cols[i]) + " IS NULL"); else buf.append(dict.getColumnDBName(cols[i]) + " = ?"); hasWhere = true; } return buf.toString(); }
public Row getRow(Table table, int action, OpenJPAStateManager sm, boolean create) { // verionable mappings will never want to create rows, so we // can always safely return null if (table != getTable()) return null; return this; }
public Row getRow(Table table, int action, OpenJPAStateManager sm, boolean create) { // verionable mappings will never want to create rows, so we // can always safely return null if (table != getTable()) return null; return this; }
public Row getRow(Table table, int action, OpenJPAStateManager sm, boolean create) { // verionable mappings will never want to create rows, so we // can always safely return null if (table != getTable()) return null; return this; }
public Row getRow(Table table, int action, OpenJPAStateManager sm, boolean create) { // verionable mappings will never want to create rows, so we // can always safely return null if (table != getTable()) return null; return this; }
public Row getRow(Table table, int action, OpenJPAStateManager sm, boolean create) { // verionable mappings will never want to create rows, so we // can always safely return null if (table != getTable()) return null; return this; }