I am using OpenJPA in my work. Sometimes I have to use JPQL and sometimes I have to use native query(em.createNativQuery).
I am witnessing a big issue with native query. I have to provide schema name too.
Like for JPQL I can write:
em.createQuery("Select e from Entity_name e").getResultList();
But in case of native query I need to do:
em.createNativeQuery("Select e from SCHEMANAME.Table_name e").getResultList()
Why is it so?And isn't this wrong behaviour as schema name may vary with time.