EclipseLink Expressions - is there a better way to design the DAO? [message #478673] |
Thu, 06 August 2009 10:51 |
Rahul Thakur Messages: 39 Registered: July 2009 |
Member |
|
|
Greetings!
I have a generic DAO with one of the API methods like this:
public interface IStore<T> {
public List<T> query(Class<T> klass, int startIdx, int range,
Expression expression) throws StoreException;
}
As you can see the Expression is externally created and passed into the
DAO implementation.
My question is: is this a bad way to design the Store API and make the
tier adjacent to the DAO responsible for creating Expression instances? In
my case Expressions are being created in Stripes Action implementations. I
do understand this makes it tied to a specific ORM provider, but what if I
know that my application is going to use EclipseLink for sure.
If this isn't a desirable design decision, can someone suggest if there is
a better way to use Expressions for creating criteria queries in my
application.
Many thanks,
Rahul
|
|
|
Powered by
FUDForum. Page generated in 0.05341 seconds