How do I create a custom SQL command and override the automatic handling in the netBeans project?
-
Can you be more specific? What "automatic handling" are you talking about?Jeremy– Jeremy2011-05-04 03:06:49 +00:00Commented May 4, 2011 at 3:06
-
So my Netbeans project uses something called EntityManager and we'd like to bypass it (download.oracle.com/javaee/5/api/javax/persistence/… )Ada– Ada2011-05-04 04:54:24 +00:00Commented May 4, 2011 at 4:54
Add a comment
|
1 Answer
The EntityManager is part of the Java Persistence API (JPA). You're either setting it up yourself or your server (persumably Glassfish inside NetBeans?) is setting it up for you.
Here's a quick example of what you can do:
Query query = entityManager.createNativeQuery("select name from people");
List<String> results = query.getResultList();