views:

28

answers:

1

Any application that deals with data, has one screen or more to allow the user to look at data. Usually we dont offer all the 10 million records to look at, but a subset, defined by a filter (or a view) that the user can create (and save). How to define these views that are translated (behind the scene) into some kind of "select from xxx where a=b and c>0;" ?

Hardcoding the selection of fields is not a very up-to-date approach. Rather offer something like a query-designer (as used in many DB GUI's like pgAdmin).

Is there any library or a solution approach that can be reused (DRY) ?

My environment: postgreSQL, Glassfish, JavaEE6, ZK

Thanks for any ideas

+1  A: 

I have always done this on my own and, yes what a pain.
You could try http://openhms.sourceforge.net/sqlbuilder/

Romain Hippeau