You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by paul miller <pa...@yahoo.com> on 2003/05/06 15:39:50 UTC
odmg select on timestamp
I'm trying to select on a timestamp value using an ODMG query
not criteria.addEqualTo(creationdate, foo.getTimestamp());
The problem is the timestamp gets changed into a String in the select
query.create("select foo from Foo. class.getName()" +
" where creationdate = \"" + foo.getTimestamp() + "\"");
I did my own FieldConversion
public Object javaToSql(Object source) throws ConversionException {
if (source instanceof java.lang.String) {
try {
return java.sql.Timestamp.valueOf((String)source);
} catch (IllegalArgumentException e) { ... }
} else {
return source;
}
}
Is this the correct way to do this?
I found nothing in the email archives,
I tried not using the "\"" quotes in the select, but got a parse error
It feels wrong to take an Object convert it into a String then convert the
String back into an Object.
thanks
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com