I am trying to use the JPA service remotely through EJB using the EasyCriteria isolated criteria generator (a very cool feature) that does not require EntityManager to write a request.
EasyCriteria<MyTable> myCriteria = EasyCriteriaFactory.createEasyCTO();
myCriteria.leftJoin(MyTable_.otherTable.getName());
Essentially, I don’t want the EJB client server to know about a database other than a schema (so there is no persistence.xml or a data source.) But I want to use Metamodel to ensure the security of schema names in these queries. The schema (objects and metamodel) is imported through a dependency on Maven.
<dependency>
<groupId>my.service</groupId>
<artifactId>my-schema</artifactId>
<version>1.1.1-SNAPSHOT</version>
</dependency>
This jar contains both JPA entities and @StaticMetamodel classes, for example
@Generated(value = "org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor")
@StaticMetamodel(MyClass.class)
public abstract class MyClass_ {
public static volatile SingularAttribute<MyClass, String> descr;
}
, MyClass () MyClass_ () , MyClass_ NPE . " ", . - , ? ?
JUnit, .