Hibernate Automatic Update table error building table or adding columns, prompting for invalid identifiers

Source: Internet
Author: User

such as an error in the Oracle database:

CREATE TABLE Db_meta_web.user (ID varchar2 (255 char) NOT NULL, account VARCHAR2 (255 char), Department VARCHAR2 (255 Char), Email varchar2 (255 char), mobile varchar2 (255 char), name VARCHAR2 (255 char), password varchar2 (255 char), PRIMARY key (ID ))

The table name user and field name password fields Here are reserved keywords, so the error identifier is invalid.

In this case, you need to put the DDL statement in the Database Connection tool, with the corresponding identifiers quoted in the database, such as MySQL is ', Oracle is '. To run it yourself, you need to note that the field is case-sensitive and the field name you define is consistent.

For the above example, the DDL statement should read:

CREATE TABLE Db_meta_web. " USER "(ID varchar2 (255 char) NOT NULL, account VARCHAR2 (255 char), Department VARCHAR2 (255 Char), email varchar2 (255 char) , Mobile VARCHAR2 (255 char), name VARCHAR2 (255 char), "PASSWORD" varchar2 (255 char), primary key (ID))

Hibernate Automatic Update table error building table or adding columns, prompting for invalid identifiers

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.