On Monday, February 25, 2013 9:43:41 AM UTC-5, Lukas Eder wrote:
>
>
> > It seems to me I don't understand this function - if we have a 
> > SQLDataType.OTHER here then the type is always assignable, which leads 
> us 
> > into getDataType() which will always throw an exception. 
> > If the type is OTHER, then we really shouldn't be trying to "find" any 
> type, 
> > just returning type OTHER and be done with it? 
>
> Hmm, that mostSpecific() method was explicitly introduced in order to 
> "downcast" a DataType such as OTHER to a more specific data type, if 
> such "more specific type information" is available. Whew. This was 
> issue #2007 as stated in the method's Javadoc: 
> https://github.com/jOOQ/jOOQ/issues/2007 
>
> A use-case for this is the following predicate: 
> create.fieldByName("TEST_COLUMN").lessThan(now) 
>
> The left-hand side of the predicate lacks type information 
> (Field<Object>), so the bind value from the right-hand side should not 
> be OTHER, but some more specific data type. 
>
> But still, there should be no NullPointerException. I have registered 
> #2267 for this. I'll try to reproduce this and see if it can be fixed, 
> soon... 
> https://github.com/jOOQ/jOOQ/issues/2267 
>
>
Yeah I was just reading this code change log about this...

Is there a missing case here? Basically, I see this as a difference of an 
unresolved type vs the type OTHER (which is specifically unspecified - 
hahah).

Maybe you really need to have something like:

SQLDataType.USERDEFINED
SQLDataType.UNRESOLVED

Instead of overloading SQLDataType.OTHER.



The NPE was coming out of my trying to use create.insertInto query parts 
instead of a Record.store() call. Basically, I have to cast the 
pgo.toString() result to a type in the query right now, and the code is 
super bad.

So its critical that I be able to pass the PGobject through to 
JDBC, unmolested by jOOQ - to put it bluntly.

Is there any way to get the statement a store would make, or approximate 
it? I'll go look into doing something like 
create.insertInto(TABLE).values(Record).toSQL() without binding the 
variables or something... Then I could build the batch query myself using 
JDBC. Then I could use Record.intoArray() or something to build the 
parameter list....










 

-- 
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/groups/opt_out.


Reply via email to