Now do a project that was previously connected to someone else's machine data, and then I'm going to import the data into the local database and run the error, as follows:
Hibernate:select sum (rdb_alert_0_. Event_count) as col_0_0_ from Eapsoft. New_topices 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 the Plsql develop, "Eapsoft" in the above statement. Delete, the operation is successful;
The analysis of SQL statements in Oracle reveals that:
1). Select SUM (rdb_alert_0_. Event_count) as col_0_0_ from Eapsoft. New_topices rdb_alert_0_
This statement queries the user "Eapsoft" has the data, the prefix represents a user, and in my local, I did not create the name "Eapsoft" user, of course, it does not have the relevant data, so it query failed.
2. Why would hibernate add the "Eapsoft" prefix to this statement?
Analysis found: In the file named NEWTOPICES.hbm.xml, there are the following statements:
<class name= "newtopices" table= "New_topices" lazy= "false" Schema= "Eapsoft" >
..............
</class>
The writer of the file adds the attribute schema= "Eapsoft" in the <class> to a user that it represents in Oracle;
3. This concludes the problem, and the main problem is the use of Hibernate and Oracle in conjunction with the schema attribute.
Delete the schema= "Eapsoft" or change it to your current user.