Hmmm, no that is not possible. It's not difficult at all to implement, just need to come up with a syntax for it. Look at fieldParameter for the implementation.

public Update fieldParameter(String field, String alias)
{
if (null == field) throw new IllegalArgumentException("field can't be null."); if (0 == field.length()) throw new IllegalArgumentException("field can't be empty."); if (null == alias) throw new IllegalArgumentException("alias can't be null."); if (0 == alias.length()) throw new IllegalArgumentException("alias can't be empty.");

        clearGenerated();

        addFieldParameter(alias);

        return _field(field, "?");
}


Any ideas about the syntax you'd like?


On 06 Aug 2006, at 05:53, Steven Grimm wrote:

I couldn't see a way to do this using the query builder API:

       DbPreparedStatement stmt = _datasource.getConnection()
           .getPreparedStatement(
               "UPDATE foo SET bar = bar + ? WHERE id = ?");
       stmt.setInt(1, amount);
       stmt.setInt(2, id);
             stmt.executeQuery();

I can call Update.fieldCustom() but I don't see a way to put a bind variable in the custom value expression (or rather, a way to assign a value to the variable.)

Possible at present?

-Steve
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users


--
Geert Bevin
Uwyn "Use what you need" - http://uwyn.com
RIFE Java application framework - http://rifers.org
Music and words - http://gbevin.com


_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users

Reply via email to