Hi Ian,
Work hasn't started yet on the TypeProviders. The general idea, however, is
to provide an SPI of this form (actual API may vary completely):
package org.jooq;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLInput;
import java.sql.SQLOutput;
public interface TypeProvider<T> {
String sql (TypeProviderContext ctx, T value);
void register(TypeProviderContext ctx, CallableStatement cs, int
parameterIndex);
void set (TypeProviderContext ctx, PreparedStatement stmt, T
value);
void set (TypeProviderContext ctx, SQLOutput o, T value);
T get (TypeProviderContext ctx, ResultSet rs, int columnIndex);
T get (TypeProviderContext ctx, CallableStatement cs, int
parameterIndex);
T get (TypeProviderContext ctx, SQLInput i);
}
Unlike the current Converters, there is no notion of actual data type
conversion in this SPI, and thus no <U> and <T> type. Instead, jOOQ will
call this SPI to implement pretty much all interaction with JDBC. You can
then bind your implementation on any column, e.g. on TIMESTAMPTZ columns,
and extend jOOQ completely transparently.
There will also be a DefaultTypeProvider that implements all the existing
functionality that is spread across org.jooq.impl.Val, org.jooq.impl.Utils,
org.jooq.impl.DefaultBindContext, and other types.
Hope this helps,
Lukas
2014-10-02 13:26 GMT+02:00 Ian Phillips <[email protected]>:
> Hi Lukas,
>
> No, I don't think that it's possible to get it to work with the current
> API. The problem is that there seems to be no way to use a forcedType to
> make the column get created as a String instead of a Timestamp, while at
> the same time associating it with a DateTime.
>
> Is there any documentation on the TypeProviders mechanism that you
> mentioned, and is it available in the current 3.5 snapshot?
>
> 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.
>
--
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.