Hi Patrik,

That's a very interesting issue :-)

I will run this through Stack Overflow to get some deeper understanding of
why the local member shadows the entire package, and how this could be
circumvented:
http://stackoverflow.com/q/19406673/521799

If no thorough solution can be found, then I guess I'll have to play around
with static importing INTERNATIONALISATION in the event of a collision.
Another option might be to create a private "companion" class
Language______ (or so), and delegate the getSchema() code to that class. I
have registered #2781 for this.
https://github.com/jOOQ/jOOQ/issues/2781

There are two workaround that I can see:
- Generate your code into another package
- Write your generator strategy to rename the "de" enum literal to "de_"

For the latter, see:
-
http://www.jooq.org/doc/3.2/manual/code-generation/codegen-generatorstrategy/
-
http://www.jooq.org/doc/3.2/manual/code-generation/codegen-matcherstrategy/

Cheers
Lukas

2013/10/16 <[email protected]>

> Hi everyone,
>
> I think I found a tiny bug in the enum creation...
>
>
> package de.company.project.internationalisation.enums;
>
> /**
>  * This class is generated by jOOQ.
>  */
> @javax.annotation.Generated(value    = { "http://www.jooq.org";, "3.2.0" },
>                             comments = "This class is generated by jOOQ")
> @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
> public enum Language implements org.jooq.EnumType {
>
> ....
>
> cy("cy"),
>
> da("da"),
>
> de("de"),
>
> dz("dz"),
>
> el("el"),
>
> ....
>
> /**
>  * {@inheritDoc}
>  */
> @Override
> public org.jooq.Schema getSchema() {
> return
> de.company.project.internationalisation.Internationalisation.INTERNATIONALISATION;
> }
>
> }
>
> Obviously, the code generator creates the package name de.company....
> which collides with the enum
> value 'de'. The compiler tries to dereference de.company on the enum
> instance, which is not going to work :(
>
> Eclipse complains with 'cannot resolve variable or field'
>
> Any chances to get a workaround for that ?
> Best,
> Patrik
>
>
>  --
> 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.
>

-- 
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