Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] ExpressionBuilder vs CriteriaBuilder...

Hi Vaidya,

As you mention, CriteriaBuilder is the specification-based way of creating query criteria. The best way to find examples is to look for JPA-specific tutorials rather than EclipseLink-specific tutorials.

When you use CriteriaBuilder (or JPQL) to build a query in EclipseLink, the underlying code builds a query based on the EclipseLink Expression API, and that is what ends up being executed.

As for differences, because all queries end up being Expression queries, everything you can do in Critiera API is available in EclipseLink Expression API.

The specification covers a reasonably high percentage of what you are likely to want to query on, but yes, there are features in the EclipseLink query API that will either be covered by future specifications, or will only be available in EclipseLink.

The good news is that if you write your application based on the Criteria API, in general, if you feel there is something missing that is available in EclipseLink, there is no reason you can't use the EclipseLink API for the parts where there is a gap. There are a number of ways to get at EclipseLink specific functionality (QueryHints, unwrapping, JpaHelper).

-Tom

On 15/06/2012 2:41 PM, vaidya nathan wrote:
JPA2 has CriteriaBuilder and i was expecting some examples of
eclipselink to have them but wherever i see I always see the
ExpressionBuilder which is eclipselink. Is there any relation between
these two. Also since Eclipselink is the reference implementation are
there any gaps in the JPA2 that Eclipselink specific apis are filling
in ?  It almost looks like CriteriaBuilder and Criteria are an exact
replica of ExpressionBuilder and Expression ..

We are currently using Eclipselink specific apis and want to know
whether we would be missing some functionality that is available in
Eclipselink if we migrate to using jpa 2 apis alone..

Cheers
Vaidya
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top