Oh!
You are right!
I should initialize a new copy to solve problem. I could get there
.............
Thank you again and again and again for your fantastic support (and
patience)!!
Best regards,
Agharta
Il giorno giovedì 1 marzo 2012 16:20:00 UTC+1, Lukas Eder ha scritto:
>
> Hello,
>
> The offending piece of logic is here
> This adds all fields from a table to a select clause
>
> sq.addSelect(returningFields);
>
> This adds new fields to the fromFrom table's internal list of fields:
>
> List<Field<?>> allFields = fromTable.asTable().getFields();
> for (int x = 0; x < joinTables.size(); x++) {
> allFields.addAll(joinTables.get(x).asTable().getFields());
> }
>
> Every time you're running the above loop, the generated table instance
> gets new fields.
> As a workaround, you should not modify the result from getFields(),
> but create your own copy like this:
>
> List<Field<?>> allFields = new
> ArrayList<Field<?>>(fromTable.asTable().getFields())
>
> Clearly, this is a flaw in jOOQ and will be corrected in the next
> release. Generated Tables are expected to be immutable objects:
> https://sourceforge.net/apps/trac/jooq/ticket/1199
>
> Thanks for reporting this!
>
> Cheers
> Lukas
>
>