users@glassfish.java.net

JPA/View Problem

From: <glassfish_at_javadesktop.org>
Date: Tue, 12 May 2009 14:22:09 PDT

Hi all,

I've searched the forum and it looks as if JPA does support views, which is what I am trying to do -- but having a problem. In my case, the view is owned by another schema. When I connect to the Oracle 10 schema using a tool like Toad, I can't see the view even though I can query it. I tried the query select * from user_views which produced no result. When I try to configure JPA (backed by Hibernate) I get the error:

Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: XXXX] Unable to build EntityManagerFactory
    ...
    [junit] Caused by: org.hibernate.HibernateException: Missing table: VIEW_TABLE

I complained about this to my DBA, but the answer I get is:

[quote]
The system view user_views only shows views that the user owns. The view is owned by another schema. It is in all_tab_privs. If you can run ' select * from VIEW_TABLE', I don't know how it can be a permission issue.
[quote]

How can I get past this problem?

Any reply would be appreciated!
[Message sent by forum member 'michaelgriffith' (michaelgriffith)]

http://forums.java.net/jive/thread.jspa?messageID=346018