Currently I'm using the last one 3.7.2.

Il giorno lunedì 8 febbraio 2016 13:27:51 UTC+1, Lukas Eder ha scritto:
>
> Hi Denis,
>
> Thanks for your message.
>
> Yes, Field.field(Field) returns null if the argument field is unmatched. 
> This is by "design", although a design that we regret. This (and other 
> methods that are currently returning null rather than throwing an 
> exception) will be corrected in jOOQ 4.0:
> https://github.com/jOOQ/jOOQ/issues/4477
>
> However, I cannot reproduce the issue you've run into. In the latest jOOQ 
> version, the call to onKey(ForeignKey, Table, Table) is guarded due to a 
> fix via
> https://github.com/jOOQ/jOOQ/issues/4637
>
> What jOOQ version are you using?
>
> Best Regards,
> Lukas
>
> 2016-02-07 14:22 GMT+01:00 Denis Miorandi <[email protected] 
> <javascript:>>:
>
>> I've made an error writing a jooq query using syntax
>>
>> .innerJoin(TABLE).onKey(Keys.FOREIGN_KEY_NAME) .....
>>
>> putting the wrong FK keyname. The strange thing is that the outcome was a 
>> null value inside the "on" clause cause field was not on primary key.
>> IMHO result should be an exception.
>>
>> In my case code is the following, inside org.jooq.impl.JoinTable
>>
>>   @SuppressWarnings({ "unchecked", "rawtypes" })
>>     private final JoinTable onKey(ForeignKey<?, ?> key, Table<?> fk, 
>> Table<?> pk) {
>>         JoinTable result = this;
>>
>>         TableField<?, ?>[] references = key.getFieldsArray();
>>         TableField<?, ?>[] referenced = key.getKey().getFieldsArray();
>>
>>         for (int i = 0; i < references.length; i++) {
>>             Field f1 = fk.field(references[i]);
>>             Field f2 = pk.field(referenced[i]);
>>               
>> *            HERE f2 is null. Why you didn't throw and exception here? Is 
>> it by design?*
>>
>>             // [#2870] TODO: If lhs or rhs are aliased tables, extract 
>> the appropriate fields from them
>>             result.and(f1.equal(f2));
>>         }
>>
>>         return result;
>>     }
>>
>>
>> Tks
>>
>> Denis
>>
>> -- 
>> 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] <javascript:>.
>> 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.

Reply via email to