I was wondering why I couldn't seem to use Criteria in my persistence layer until I realized that I was compiling my code against JPA 1 classes. I then analyzed what the JAR builder does and found this in the output:
Integrating jar -->(1)/(25949)/C:\Oracle\Middleware\modules\javax.persistence_220.127.116.11_1-0-2.jar
Integrating jar <--(1)/(26042)/(93)/C:\Oracle\Middleware\modules\javax.persistence_18.104.22.168_1-0-2.jar
This explains perfectly why I can't use Criteria in my IDE - I'm simply compiling against the wrong JPA API. Can anyone explain to me why the JAR builder (I used com.bea.core.jarbuilder_22.214.171.124.jar which is packaged with WL 12c) doesn't integrate the javax.persistence_126.96.36.199_2-0.jar into the wlfullclient.jar when TopLink + JPA 2 is the default in WL 12c? Is there any way to get JPA2 into the fullclient JAR without any dirty hacks?