Thanks Lukas.
I had setup a "test harness" for querydsl and found myself comparing the
two.
To get a list of single field (TITLE) from a table (BOOKMARK), here's how
the two work out:-
Querydsl:
List<String> titles = query.from(bookmark).where(bookmark.mapType.eq("none"
)).list(bookmark.title);
JOOQ:
List<String> jTitles = create.select(BOOKMARK.TITLE).from(BOOKMARK).where(
BOOKMARK.MAP_TYPE.equal("none")).fetch(BOOKMARK.TITLE);
Since I already have TITLE in the select part, why should I repeat myself
and add it in the fetch part. With Querydsl that issue is not there since
they have done away with select.
If I follow that strategy in JOOQ, I end up querying all the columns and
then fetching just the title.
jTitles = create.fetch(BOOKMARK, BOOKMARK.MAP_TYPE.equal("none"
)).getValuesAsString(BOOKMARK.TITLE);
The time taken by both queries to execute (including fetch time) is
significant (24 vs 46ms).
Is there a better way of doing it.
Thanks,
Dileep
On Saturday, May 5, 2012 8:22:11 PM UTC+5:30, Lukas Eder wrote:
>
> Hello,
>
> > Considering all this - and most importantly that I like Spring jdbc
> > managing my connections - hopefully using Sergei's(?) Proxy- which
> > version should I try out? 2.2.2 or 2.3?
>
> 2.3 will be released this weekend. You may give it a shot and build it
> yourself from GitHub, or wait for two days while experimenting with
> 2.2.2. In essence, the added FactoryProxy is just convenience for the
> automatic handling of obtaining a JDBC connection from a data source
> and using Springs magic to close the connection again. This will be
> documented when 2.3.0 is released. But you can use jOOQ with Spring
> without using the FactoryProxy.
>
> The talks about version 3.0 later this year are (among other points)
> about the fact that jOOQ should better separate the SQL query builder
> functionality from the query execution functionality. This would
> greatly simplify the usage of DataSources, such as those provided by
> Spring. The 2.x version stream is not a dead end, though. It will
> still be maintained once 3.0 is live.
>
> > Is the documentation in your site for 2.2 or 2.3?
>
> It is for the latest released version, i.e. 2.2
>
> Cheers
> Lukas
>