Is the package containing your entities on the classpath? I.e.: value = 'com.example.jpa'
The JPADatabase uses Spring and Hibernate behind the scenes to scan your classpath for entities in that package, but it can find them only if they are on your classpath... 2016-11-13 19:33 GMT+01:00 TS TS <[email protected]>: > I didn't try but yes, it was plugin issue (upgrade solve it). > Now it generates code from all schemas (public_, information_schema) but > without my tables. > Maybe it is the same situation like here http://www.jooq.org/doc/3 > .1/manual/code-generation/codegen-configuration/#comment-2754812970 ? > > On 13 November 2016 at 19:10, Lukas Eder <[email protected]> wrote: > >> Hmm, interesting. I suspect this might be an issue in the gradle plugin >> (or in gradle in general) related to how the properties object is set to >> the Configuration. You've mentioned this: >> >> java.lang.NullPointerException >> at org.jooq.util.jpa.JPADatabase.create0(JPADatabase.java:79) >> at org.jooq.util.AbstractDatabase.create(AbstractDatabase.java:209) >> >> JPADatabase.java:79: String packages = getProperties().getProperty("p >> ackages"); >> >> I don't see how that getProperties() element can return null, except if >> someone (or some gradle magic) explicitly sets it to null on the >> JPADatabase object. >> >> Have you tried debugging through the code generator? >> Best Regards, >> Lukas >> >> 2016-11-13 9:08 GMT+01:00 TS TS <[email protected]>: >> >>> Yes, of course. And I have been using it before with mysql codegen >>> without problems. But now, with jpa codegen, it doesn't work for me. >>> >>> On 12 November 2016 at 22:04, Lukas Eder <[email protected]> wrote: >>> >>>> Hello, >>>> >>>> It should work as documented in the third party plugin: >>>> https://github.com/etiennestuder/gradle-jooq-plugin >>>> >>>> Have you tried those instructions? >>>> >>>> Cheers, >>>> Lukas >>>> >>>> 2016-11-12 18:58 GMT+01:00 TS TS <[email protected]>: >>>> >>>>> Thanks Lukas, it helped. >>>>> I modified dependencies also: >>>>> >>>>> jooqRuntime "org.jooq:jooq-meta-extensions:${jooqVersion}" >>>>> >>>>> jooqRuntime "commons-logging:commons-logging:1.2" >>>>> Now it generates all schemas(public_, information_schema) but without >>>>> my tables. @Dominik, how did you added them for plugin classpath? >>>>> >>>>> Maybe it is the same situation like here http://www.jooq.org/doc/3 >>>>> .1/manual/code-generation/codegen-configuration/#comment-2754812970 ? >>>>> >>>>> >>>>> W dniu sobota, 12 listopada 2016 15:12:13 UTC+1 użytkownik Lukas Eder >>>>> napisał: >>>>>> >>>>>> Hello, >>>>>> >>>>>> I suggest upgrading to the latest nu.studer:gradle-jooq-plugin >>>>>> version, which is 2.0.2: >>>>>> https://plugins.gradle.org/plugin/nu.studer.jooq >>>>>> >>>>>> There had been a variety of fixes just recently related to this third >>>>>> party plugin's hard-wiring of the jOOQ version to 3.6.2, I believe. >>>>>> >>>>>> Hope this helps, >>>>>> Lukas >>>>>> >>>>>> >>>>>> 2016-11-11 20:01 GMT+01:00 TS TS <[email protected]>: >>>>>> >>>>>>> Hello, >>>>>>> I have problem with JPADatabase generator and Gradle too. I know how >>>>>>> to add packages property owing this topic. But it finish with: >>>>>>> java.lang.NullPointerException >>>>>>> at org.jooq.util.jpa.JPADatabase.create0(JPADatabase.java:79) >>>>>>> at org.jooq.util.AbstractDatabase.create(AbstractDatabase.java:209) >>>>>>> >>>>>>> JPADatabase.java:79: String packages = getProperties().getProperty( >>>>>>> "packages"); >>>>>>> >>>>>>> How properies can be null here? My build.gradle looks like this: >>>>>>> >>>>>>> >>>>>>> buildscript { >>>>>>> >>>>>>> /*...*/ >>>>>>> >>>>>>> dependencies { >>>>>>> classpath("org.springframework.boot:spring-boot-gradle-plugin: >>>>>>> ${springBootVersion}") >>>>>>> classpath 'nu.studer:gradle-jooq-plugin:1.0.5' >>>>>>> classpath 'mysql:mysql-connector-java:6.0.3' >>>>>>> classpath 'org.jooq:jooq-meta-extensions:3.8.0' >>>>>>> } >>>>>>> } >>>>>>> >>>>>>> /*...*/ >>>>>>> >>>>>>> generator { >>>>>>> name = 'org.jooq.util.DefaultGenerator' >>>>>>> strategy { >>>>>>> name = 'org.jooq.util.DefaultGeneratorStrategy' >>>>>>> } >>>>>>> database { >>>>>>> name = 'org.jooq.util.jpa.JPADatabase' >>>>>>> properties { >>>>>>> property { >>>>>>> key = 'packages' >>>>>>> value = 'com.example.jpa' >>>>>>> } >>>>>>> } >>>>>>> } >>>>>>> generate { >>>>>>> } >>>>>>> target { >>>>>>> } >>>>>>> } >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> W dniu czwartek, 20 października 2016 21:47:23 UTC+2 użytkownik >>>>>>> Lukas Eder napisał: >>>>>>>> >>>>>>>> Hi Dominik >>>>>>>> >>>>>>>> Thanks a lot for your feedback. I'm happy to hear that it works now >>>>>>>> for you. >>>>>>>> >>>>>>>> You're right of course, my bad. With jOOQ's standalone features, >>>>>>>> there aren't any dependencies, in case of which the standalone code >>>>>>>> generator works well, but the jOOQ-meta-extensions module has those >>>>>>>> dependencies and their transitive dependencies... >>>>>>>> >>>>>>>> You could still use the standalone code generator from within >>>>>>>> Gradle, though, in case of which the code generator inherits Gradle's >>>>>>>> class >>>>>>>> path, but I guess that's no longer needed now. >>>>>>>> >>>>>>>> Excellent, I'd be very curious to learn more about your lecture's >>>>>>>> content. Are your slides available online, somewhere? Btw: I'm passing >>>>>>>> FHNW >>>>>>>> just now on a train to Zurich :-) >>>>>>>> >>>>>>>> Best Regards, >>>>>>>> Lukas >>>>>>>> >>>>>>>> 2016-10-20 18:07 GMT+02:00 Dominik Gruntz <[email protected]>: >>>>>>>> >>>>>>>>> Great! Thanks for the immediate feedback and help! >>>>>>>>> >>>>>>>>> > As a workaround, you can specify the <inputSchema/> >>>>>>>>> configuration to include only your schema. >>>>>>>>> OK. Specification of >>>>>>>>> inputSchema = 'PUBLIC' >>>>>>>>> in the database section of the generator is possible and prevents >>>>>>>>> generation of classes for tables in the information_schema. >>>>>>>>> >>>>>>>>> > Are those JPA-annotated entities on the jOOQ code generator's >>>>>>>>> classpath? >>>>>>>>> Good question. No, these classes were not on the class path! I >>>>>>>>> just added them, and now code is generated, and due to the above >>>>>>>>> inputSchema definition only for the public schema. >>>>>>>>> >>>>>>>>> > There's always the possibility of falling back to using the >>>>>>>>> standalone code generator from within Gradle (using the latest jOOQ >>>>>>>>> version): >>>>>>>>> I tried to invoke the converter from the command line as described >>>>>>>>> in http://www.jooq.org/doc/3.8/manual/getting-started/tutorials >>>>>>>>> /jooq-in-7-steps/jooq-in-7-steps-step3/, but I gave up at some >>>>>>>>> point as I had to add too many jar files on the class path (the whole >>>>>>>>> dependency to hibernate in case of the JPADatabase). >>>>>>>>> >>>>>>>>> But my example works now, which is great! >>>>>>>>> I will demonstrate that in the next lecture (in a course on JPA...) >>>>>>>>> >>>>>>>>> Thanks again >>>>>>>>> Dominik >>>>>>>>> >>>>>>>>> >>>>>>>>> -- >>>>>>>>> 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. >>>>>>>>> >>>>>>>> >>>>>>>> -- >>>>>>> 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. >>>>>>> >>>>>> >>>>>> -- >>>>> 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. >>>>> >>>> >>>> -- >>>> You received this message because you are subscribed to a topic in the >>>> Google Groups "jOOQ User Group" group. >>>> To unsubscribe from this topic, visit https://groups.google.com/d/to >>>> pic/jooq-user/2yvcZ1Vh_Bs/unsubscribe. >>>> To unsubscribe from this group and all its topics, send an email to >>>> [email protected]. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >>> >>> -- >>> >>> pozdrawiam, >>> Tomasz Skowroński >>> >>> -- >>> 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. >>> >> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "jOOQ User Group" group. >> To unsubscribe from this topic, visit https://groups.google.com/d/to >> pic/jooq-user/2yvcZ1Vh_Bs/unsubscribe. >> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > > pozdrawiam, > Tomasz Skowroński > > -- > 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. > -- 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.
