I have a project using JPA's <non-jta-datasource>
in persistence.xml
to connect to a container-managed Oracle Datasource, and I have to use in some point a native query that is built dynamically. By default in Oracle I need to specify the schema
in the table name to make a query, but I don't have access to the schema name (and shouldn't).
First of all, is this an expected behavior? If I execute SELECT * FROM TABLE
should Hibernate rename it to the Datasource parameters and execute SELECT * FROM SCHEMA.TABLE
instead?
If it's not, is there a way to retrieve the schema name dinamycally? Even if the datasource is managed by WebLogic/JBoss?