I know about using customTypes and forcedTypes to create my own custom type 
Converters, but even when doing this jooq makes some assumptions about the 
data type based on what it reads from the DB schema.

Here's my situation: I have a column of type timestamptz (in Postgres) and 
I'd like to be able to represent it as an org.joda.time.DateTime object in 
my application code.

What I really want to be able to do is this:

public class DateTimeConverter implements Converter<String, DateTime> {

    private static final DateTimeFormatter dateTimeFormatter = new 
DateTimeFormatterBuilder()
            // ...
            .toFormatter();

    @Override
    public DateTime from(String databaseObject) {
        return databaseObject != null ? DateTime.parse(databaseObject) : 
null;
    }

    @Override
    public String to(DateTime userObject) {
        return userObject != null ? userObject.toString(dateTimeFormatter) 
: null;
    }
    // ...
}

But of course this doesn't work as jooq tries to give me a 
java.sql.Timestamp object to work with. If I'm using raw JDBC I have no 
trouble calling rs.getString instead of rs.getTimestamp but there doesn't 
seem to be a way to tell jooq to do the same.

I've noticed that there seem to be some data type related changes coming in 
3.5.0, am I basically hosed until then?

Cheers,
Ian.

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to