Table or view does not exist Hibernate Oracle

Source: Internet
Author: User
Tags sql error

Ever run a program written by someone else, before even the data of someone else's machine, then I import the data into the local database to run, error, as follows:
Hibernate:select sum (rdb_alert_0_. Event_count) as col_0_0_ from ASICDB. Rdb_alert_security_view rdb_alert_0_
–sql error:942, sqlstate:42000
–ora-00942: Table or view does not exist

It is also an error to run the SQL statement in Plsql develop, putting "asicdb." in the above statement. Deleted, the operation is successful;

Analyzing the SQL statements in Oracle can reveal:
1). Select SUM (rdb_alert_0_. Event_count) as col_0_0_ from ASICDB. Rdb_alert_security_view rdb_alert_0_
The statement queries the data owned by the user "asicdb", the prefix represents a user, and in my local, I did not create a user named "Asicdb", of course, it does not have the relevant data, so it failed to query.

2). Why does hibernate add the "asicdb" prefix to this statement?
Analysis found: In the file named RDB_ALERT_VIEW.hbm.xml, there are the following statements:
<class name= "Rdb_alert_view" table= "Rdb_alert_security_view" lazy= "false" Schema= "ASICDB" >

..............

</class>
The writer of the file adds the attribute schema= "asicdb" to the <class>, which is represented by a user in Oracle;

3). This concludes the problem, and the main problem is the use of Hibernate and Oracle in conjunction with schema properties.

Original: http://blog.csdn.net/wwbmyos/article/details/21334341

Table or view does not exist Hibernate Oracle

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.