Hi,
Right now I'm using the generic facility in opencsv to stream a result
set to CSV. I'd like to do Excel friendly quoting of specific fields,
which I can do outside of JOOQ.
That said, the CSV dumping facility is very generic and quite simple
and all of the strongly typed metadata about what column is what is
(of course) in the JOOQ layer.
So what I'd like to do is to push the selective formating back down to
JOOQ, which seems to work well for simple queries by doing stuff like:
Field<String> EXCEL_FIELD =
DSL.field("concat('=\"',field_that_excel_is_not_down_with,'\"')",
String.class);
But for more highly factored queries with subselects, joins and
windowing, this becomes an issue. Most of my queries are built up from
the inside out using the fluent API so that I can re-use stuff as
building blocks. So I don't want to push this formatting down into the
core of the query building.
Rather, I would prefer to be able to declare filters on specific
columns of the outer select statement. I could code this by hand, but
it circumvents the factoring powers of JOOQ, which is not so cool.
I like the way you can go to town with subselects and then at the
outer layer you can do something like
ctx.select().from(ranked).where(RANK.le(10));
a you don't have to re-specify the columns because they are implicit.
Is there a way to have JOOQ do something like
ctx.select().patch(EXCEL_FIELD,
SOME_OTHER_FIELD).from(ranked).where(RANK.le(10));
Such that EXCEL_FIELD and SOME_OTHER_FIELD get reformatted according
to their custom definitions, but all of the other fields stay as is?
Or is there a much simpler way to do this kind of thing, e.g.
ctx.select().from(ranked).where(RANK.le(10)).setExcelFriendly(true)?
?
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/groups/opt_out.