How can I call my own custom SQL code inside my Java EE project on NetBeans
How do I create a custom SQL command and override the automatic handling in开发者_运维知识库 the netBeans project?
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();
This is a more complete example.
精彩评论