Hi Lukas,

In your blog post regarding unnecessary work, I wonder jOOQ could do better 
when it known the fields the user is consuming. 

Take for example,
List<String> title = db.selectFrom(BOOK).where(BOOK.AUTHOR.eq("Robert 
Heinlein")).fetch(BOOK.TITLE);

This will generate a query like,
SELECT book.id, book.author, book.title, book.isbn FROM book WHERE 
book.author = 'Robert Heinlein';

This kind of shorthand is pretty common to see, instead of the more correct 
query.
List<String> title = 
db.select(BOOK.TITLE).from(BOOK).where(BOOK.AUTHOR.eq("Robert 
Heinlein")).fetch(BOOK.TITLE);

Ideally the renderer would optimize these queries to fetch only the 
necessary fields. Do you think jOOQ could do this in the simple cases?

Cheers,
Ben

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

Reply via email to