Hi, 
thank you!

I've see the code, you're right, but....

I think that is my mistake but i've extended DefaultGeneratorStrategy like 
this.

....blablabla...


/**
     * Override this method to define how your Java classes and Java files
     * should be named. This example applies no custom setting and uses
     * CamelCase versions instead
     */
    @Override
    public String *getJavaClassName(Definition definition, Mode mode)* {
        *String str = super.getJavaClassName(definition, mode);
        if (mode == Mode.POJO) {
            str += "Pojo";
        }
        return str;*
    }


----bla bla bla------


i've see the generated code and the pojo java name is *xxxPojo.java*, 
right. But the class name definition into the file remains the old one 
(without "*Pojo*" suffix).

I've see the class DefaultGenerator and - at row *810* - it uses 

out.print(*strategy.getJavaClassName(table)*)

without *Mode* parameter. It calls *GeneratorStrategyWrapper*, *not* my *
CustomGeneratorStartegy*.

Is it right? If yes, could you explain me how to set my custom name into 
code-class definition?

Thank you again and sorry for my stupid questions.

Agharta

 




Il giorno martedì 20 marzo 2012 16:44:22 UTC+1, Lukas Eder ha scritto:
>
> Hello Agharta,
>
> Please consider this section from the manual:
> http://www.jooq.org/manual/META/AdvancedConfiguration/
>
> It explains how you can customize generated artefacts.
>
> Cheers
> Lukas
>
> 2012/3/20 Agharta agharta 
> > Hi again,
> >
> > A suggestion: because tables names and pojos class names are the same
> > (TABLE NAME = Customer.java, POJO NAME = Customer.java), a suffix in
> > Table classes or Pojo classes is suggested.
> >
> > As records (CustomerRecord.java), i suggest to modify pojo base class
> > name. Example CustomerObject.java or whatever you want.
> >
> > This is suggested because, if i use pojo classes and table classes in
> > same file, one of they is fully referenced in code (not beautiful to
> > see) and not easy to see and manage (possibility to confuse names
> > during code typing).
> >
> > I can suggest a parameter into code generator xml
> >
> > <generate>
> > ......
> >  <pojos>true</pojos>
> >  <pojos-suffix-name>Object</pojos-suffix-name>
> > ......
> > </generate>
> >
> >
> >
> > Thank you again.
> >
> > Best regards,
> >
> >            Agharta
>
>

Reply via email to