Skip to content
Advertisement

Hibernate Table or view does not exist Oracle

I Have a problem executing an hibernate query on Oracle:

my persistence.xml:

my entity class com.entity.User:

my java class:

but when i execute my code, i obtain:

Can you help me to find the error?

NOTE: if a use a PreparedStatement with the same connections and query i don’t have any issue, so it is not a problem of permissions

Advertisement

Answer

You try to use HQL query with EntityManager.createNativeQuery method. This is a mistake.

Try to correct your query in this way:

If you use the SCHEMA for all your entities, you can put it to the hibernate config:

then correct your entity definition in the following way:

and then correct your query:

P.S. And by the way, I would suggest you to correct your hibernate dialect definition. You should use as specific dialect as possible. For example if you use Oracle 10g, you should use org.hibernate.dialect.Oracle10gDialect. You can still use org.hibernate.dialect.Oracle9iDialect but some new features defined in Oracle10gDialect will not be available.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement