At the time of writing hibernate code, a "table or view does not exist" error occurs when you want to save to the Oracle database, but when you enter the database, the table is present and can be edited and analyzed to find that it was created with a "(double quote)". For example, the following is the code that creates the table:
CREATE TABLE "Servicesubscriber" (
' SubscriberId ' VARCHAR2 not NULL,
"Email" VARCHAR (128),
"Realname" VARCHAR2 (50),
"PWD" VARCHAR2 (30),
Constraint Pk_ods_custmr_servicesubscribe primary KEY ("SubscriberId")
)
/
Familiar with the Orcale friend estimated at a glance, the table name and field names above with double quotes, although the table can be successfully built, but cannot save data to the table through hibernate. The solution is to delete the above double quotes when creating the table.
CREATE TABLE Servicesubscriber (
SubscriberId VARCHAR2 (m) not NULL,
Email VARCHAR (128),
Realname VARCHAR2 (50),
PWD VARCHAR2 (30),
Constraint Pk_ods_custmr_servicesubscribe primary KEY (SubscriberId)
)
/
Because I am very unfamiliar with Oracle, the specific reason can only be inferred:
One of the rules for Oracle to create tables is:
You can use uppercase or lowercase letters when you name a table. Oracle is insensitive to capitalization as long as the table name or field name is not enclosed in double quotes. Oracle supports the syntax of using double quotes. However, it is best not to use double quotes directly.
Because the table and column names should be in double quotes when creating the query, and the query generated by hibernate will not have double quotes, an error can occur that cannot find the table or view.