/**
  * Return if the test is running against JPA 1.0. Any test that uses 2.0 functionality should call
  * this method to avoid been run against a 1.0 container.
  */
 public static boolean isJPA10() {
   try {
     LockModeType.valueOf("NONE");
   } catch (Exception e) {
     return true;
   }
   return false;
 }
Esempio n. 2
0
 /** INTERNAL: Convert the JPA query into a DatabaseQuery. */
 public DatabaseQuery processJPQLQuery(Session session) {
   ClassLoader classloader = session.getDatasourcePlatform().getConversionManager().getLoader();
   LockModeType lockModeEnum = null;
   // Must handle errors if a JPA 2.0 option is used in JPA 1.0.
   try {
     lockModeEnum = LockModeType.valueOf(lockMode);
   } catch (Exception ignore) {
     // Ignore JPA 2.0 in JPA 1.0, reverts to no lock.
   }
   DatabaseQuery ejbquery =
       EJBQueryImpl.buildEJBQLDatabaseQuery(
           this.getName(), this.jpqlString, session, lockModeEnum, this.hints, classloader);
   ejbquery.setName(this.getName());
   return ejbquery;
 }