On Mon, Apr 1, 2013 at 1:56 PM, Lukas Eder <[email protected]> wrote:
> > Topic #1: Static vs. contextual Factory methods > =============================================== > > I really liked the separating of the contextual / static query functions in JOOQ 3 - it just feels right - like real SQL. The guys I'm working with found it liberating. > > Topic #2: "Executor" as a name > ============================== > > select().from(TABLE) > .where(conditions) > .orderBy(ID); > > Here's how you'd create "contextual", and thus executable queries: > > with(configuration) > .select() > .from(TABLE) > .orderBy(ID) > .fetch(); > > Here's how you'd use batch queries: > > with(connection, dialect) // Alternatively to with(configuration) > .batch( > insertInto(TABLE_A).values(1, 2, 3), > insertInto(TABLE_B).values(4, 5, 6) > ) > .execute(); > > Now the object returned by "with()" doesn't need to be called > Executor. Neither do we need to use the term "with()", as that might > cause confusion in the future, once jOOQ supports common table > expressions. But you get the idea. What would you think of this > alternative route? > > I really like the idea of with(connection, dialect) - how would you attach the schema mappings? (they already use a similar .withMapping() function style (sort of). Though I'm a little worried about the fact that right now I have to extend Executor myself for use in Google Guice Injection. This might not play well with that. > Topic #3: Factory and Executor as short names in general > ======================================================== > > For myself, I've found static importing "Factory" a little strange - maybe it could be renamed to something like Queries or what if they were broken out into different classes named for the section they are from such as Selects, Froms, Joins, Conditions (or Wheres) etc... This is how I've token to implementing extensions to JOOQ - creating static functions in a class which is then static imported. I could give examples, if people are interested but I thought that might be off topic. :-) Pete -- 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.
