I have 3 ways things get written to the DB
public void create(T object) { entityManager.persist(object); } public void update(T object) { object = e
It looks like Avinash T. is right - if you want to create native SQL query, use createNativeQuery(String sqlString) method of EntityManager. Using createQuery(String ejbqlString) is only possible if you're using EJB QL. Hope it would help.
createNativeQuery(String sqlString)
EntityManager
createQuery(String ejbqlString)