> > > The simplest way forward might be to extend the default DAOImpl and let > the code generator use your custom DAOImpl as a base class using generator > strategies: > > One option using generator strategies would be to implement "custom code > sections", where you can add your own methods to the generated DAOs: > > http://www.jooq.org/doc/latest/manual/code-generation/codegen-generatorstrategy > > Another option would be to extend the generated DAOs and add functionality > on a per-table basis. > > But of course, your suggested option is fine, too. > > Extending the generated DAOs might not be so bad. I'll read up on what you've sent me, thanks!
In terms of my last question, regarding the TABLE object (I'm afraid I don't know a better term for it), if you look here: https://gist.github.com/dhoss/539650094085c2ef152acab6d5884a0d#file-baseservice-java-L24, you'll see I've got pseudo code attempting to try and fulfill a generic table object for the query. Normally, instead of TABLE, it would be a specific table object name generated by jooq, like GALLERY or IMAGE, in my case. I'm trying to determine what the appropriate generic would be in lieu of my pseudo code. I've dug into the generated table classes, and I've found this (apologies for the naming inconsistencies, I have some refactoring to do): public class Galleries extends TableImpl<GalleriesRecord> { private static final long serialVersionUID = 1035239683; /** * The reference instance of <code>public.galleries</code> */ public static final Galleries GALLERIES = new Galleries(); /** * The class holding records for this type */ @Override public Class<GalleriesRecord> getRecordType() { return GalleriesRecord.class; } // .... However, I attempted to make the table object generic several different types shown here, but none worked. I think I'll try your polymorphic parameter suggestion here as well, as it seems to make more sense the more I type, but I'd like your input if you have a better idea. Again, thanks for looking at this. -Devin On Wed, May 18, 2016 at 1:48 AM, Lukas Eder <[email protected]> wrote: > Hi Devin, > > Thanks for the feedback > > 2016-05-17 19:00 GMT+02:00 Devin Austin <[email protected]>: > >> Hi Lukas, >> >> This is exactly what I was looking for, thank you for responding. >> >> Regarding just using org.jooq.DAO: I am using it where I can, but >> perhaps my lack of JOOQ knowledge is causing me to run into some issues. I >> think I ran into a few things, one being I wasn't sure how to get the query >> granularity for sorting, limiting and ordering that I wanted to using the >> DAO methods. I haven't looked at this specifically in a while, so I could >> very well be missing something. >> > > No, you aren't missing anything. Currently, there aren't a lot of > possibilities for these things, out of the box. > > >> So, my next questions are: >> >> 1. What would you recommend if I were to implement this using just >> org.jooq.DAO? Again, I'll go off on my own and do some more research on >> the generated DAO methods, but I'd like some expert input. >> > > The simplest way forward might be to extend the default DAOImpl and let > the code generator use your custom DAOImpl as a base class using generator > strategies: > > One option using generator strategies would be to implement "custom code > sections", where you can add your own methods to the generated DAOs: > > http://www.jooq.org/doc/latest/manual/code-generation/codegen-generatorstrategy > > Another option would be to extend the generated DAOs and add functionality > on a per-table basis. > > But of course, your suggested option is fine, too. > > 2. What needs to be used in place of the TABLE object in my code example? >> I can see situations where I'll want to drop straight into jooq queries and >> it would be helpful to be able to do that without having to duplicate code. >> > > I'm sorry, I'm not quite sure what you mean...? Could you provide an > example? > > -- > 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/topic/jooq-user/KUPyMa2581g/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. > -- Devin Austin https://www.stonecolddev.in -- 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.
