[jboss-user] [EJB 3.0 Users] - JPQL returning JSON / Add NamedQueries dynamically

ederbaum do-not-reply at jboss.com
Tue Nov 10 21:59:14 EST 2009


Imagine a JPQL query like this:

SELECT JSON{id : p.id, name : p.name, age : p.age} FROM Person p WHERE id=?1

Ok, i know this is impossible (Actually).
But if i could find a Way to Add NamedQueries dynamically to the EntityManagerFactory , i could implement this by Myself. 

Someone here know how to do that?

I'm actually adding Annotated Classes and generating the EntityManagerFactory dynamically doing this:

Ejb3Configuration ejb3conf = new Ejb3Configuration();
  | .....
  | ejb3conf.addAnnotatedClass(aClass);	
  | ...
  | EntityManagerFactory emf = ejb3conf.buildEntityManagerFactory();


p.s: Sorry, i'm brazilian, and my english isn't so good.

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4264932#4264932

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4264932



More information about the jboss-user mailing list