In my case, I am trying to do:

AuditTable a = AuditTable.AUDITTABLE.rename("a");
// Operate with a.ID

AuditTable is code generated and extends TableImpl<AuditTableRecord>.
AuditTable.AUDITTABLE is the static member that returns "new AuditTable()"

The IDE is saying that AuditTable.AUDITTABLE.rename("a") is returning 
Table<AuditTableRecord>, not AuditTable.

Is the generated code for TBook and T_BOOK somewhere I can look at? I tried 
searching through the github repository and wasn't able to find it.

On Monday, November 13, 2023 at 3:10:31 AM UTC-5 lukas...@gmail.com wrote:

> Hi Alex,
>
> I've just tried this:
>
> TBook b = T_BOOK.rename("b");
> System.out.println(
>     ctx.select(b.ID).from(b)
> );
>
> And it prints the expected:
>
> select "public"."b"."id"
> from "public"."b"
>
> So, you're probably thinking of something *specific *that didn't work for 
> you?
>
> Best Regards,
> Lukas
>
> On Sat, Nov 11, 2023 at 5:58 PM Alex <alex.ry...@gmail.com> wrote:
>
>> Hello,
>>
>> I have a database that contains several hundred tables with the same 
>> structure, just different names. Reading through the documentation, using 
>> Table.rename(Name) seems to be most appropriate for my querying needs.
>>
>> Unfortunately, the example code on 
>> https://www.jooq.org/doc/latest/manual/code-generation/codegen-advanced/codegen-config-generate/codegen-covariant-overrides/codegen-covariant-overrides-rename/
>>  does 
>> not appear to be valid. I want to be able to do exactly what that example 
>> is doing (take a generated table, change the table name that it is 
>> associated with, and still be able to use the generated fields to produce a 
>> valid query).
>>
>> I am pretty new to jOOQ, so it is possible I am misunderstanding the 
>> intent of rename().
>>
>> Thanks,
>> Alex
>>
>> -- 
>> 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 jooq-user+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jooq-user/dcec73a5-ca53-43a8-9b49-abfd4ec9e052n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jooq-user/dcec73a5-ca53-43a8-9b49-abfd4ec9e052n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
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 jooq-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/1a124c0d-71dd-4aa0-b300-a88cd27e63a3n%40googlegroups.com.

Reply via email to