
Originally Posted by
jnsunkersett
Hi,
I landed on this forum topic searching for a generic DAO implementation.
Does Spring have any helper objects in that can assist me?
My requirement is very similar ...a generic query api ...to be explicit...:
Logic coded in my business tier works with what I call Domain objects and whenever it requires data it will call upon a Data-Provider in terms of Domain Objects.
The Data-Provider will encapsulate a database.
1. It will receive a request for data in terms of the business/ domain object,
2. internally lookup the data (using some api either JDBC/ Hibernate-ORM or similar or DAO pattern) and
3. Using some thing (what I call a Data-Mapper) will map data received from the database to the domain objects and return.
The reason behind this - my application would be using a database, whose schema (table-design) may vary by locale. By having the business tier communicate in terms of domain objects I can keep it independant of the schema and would only have to implement locale (or schema) specific data-mappers and dao.
For this I had a look at Martin Fowlers patterns :: QueryObject, DataMapper, Meta-DataMapping but implementation is quite complex
PS: I only need to support the 'R' out of CRUD (only SELECT queries with different ORDERBY, WHERE, ...)
Any comments?
~g1