Hello Dileep,

> [...]
> Wow! Things got really easy then on. In a matter of lines I had my
> conditions and sorts sorted out.

Yes, some prefer it the hard way ;-)
Just kidding. Did you think this section of the manual should be more
prominent? How can I improve the manual to make these things clearer?

> Now the only issue is to do a select(count(*)) in a similar manner - any
> pagination search implementation needs one. The problem is that I cannot
> find a way of doing in a non DSL manner.

Some insight:

1. You can always access an org.jooq.SelectFinalStep's underlying
SelectQuery object using
http://www.jooq.org/javadoc/latest/org/jooq/SelectFinalStep.html#getQuery()

This allows to mix DSL and non-DSL query construction. Most
SelectXXXStep types extend the SelectFinalStep.

2. You can decide from the Factory / FactoryOperations API whether you
want to build a DSL or non-DSL query. For non-DSL queries, use
http://www.jooq.org/javadoc/latest/org/jooq/FactoryOperations.html#selectQuery()

Note, FactoryOperations.selectCount() is only a convenience method for
FactoryOperations.select(Factory.count())

3. Factory.count() is the right method to construct a COUNT(*)
expression. You're close with your example code:
http://www.jooq.org/javadoc/latest/org/jooq/impl/Factory.html#count()

Putting things together:

FactoryOperations f = // Your Spring initialisation logic
SelectQuery s = f.selectQuery();
s.addSelect(Factory.count());
s.addFrom(USER_REQUEST);
s.addXXX(...);

Does this help?

Cheers
Lukas

Reply via email to