[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.rt.eclipselink] EclipseLink Expressions - is there a better way to design the DAO?

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