Hi,

I wrote a dyanamic query using JPA 2 Criteria API. At present i have
implemented it below:
Root<Certificate> cert = cq.from(Certificate.class);
                Join&lt;Certificate, Loan&gt; l = cert.join("loan");
                SetJoin&lt;Loan, Borrower&gt; lb = l.joinSet("loanBorrowers");
                Join&lt;Loan, Branch&gt; b = l.join("branch1");
                Join&lt;Branch, Customer&gt; cu = 
b.join("FK__Branch__Customer");

//then list of predicate
Predicate predicate = cb.equal(lb.get("number"),number.toString());
                        predicateList.add(predicate);
cq.where(predicates);
                cq.multiselect(cert.get("Cert_Number"), cu.get("Cust_Number"),
b.get("Branch_Seq_ID"), b.get("Branch_Check_Digit")).distinct(true);

                TypedQuery&lt;Object[]&gt; typedQuery = em.createQuery(cq);

Other way is to use metamodel entities.like instead of Join&lt;Certificate,
Loan&gt; l = cert.join("loan")

Join&lt;Certificate, Loan&gt; l = cert.join(Certificate_.loan");

This creates metamodel classes (i.e. with _). When i execute code, i am
getting error saying these classes are not enhanced. so how to enhance these
classes. Second question is, if i use enhanced classes then are there any
performance issues?

Thanks
Chintan--
View this message in context: 
http://openjpa.208410.n2.nabble.com/Need-suggestion-on-Metamodel-usage-tp6317331p6317331.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to