简体   繁体   中英

JDBC Derby JPA Persistence testing issue “Internal Exception: java.sql.SQLSyntaxErrorException: Syntax error: Encountered 'USER'”

I have an entity class called User and when I do persistence testing with Arquillian I have always have an error...

Internal Exception: java.sql.SQLSyntaxErrorException: Syntax error: Encountered "USER" at line 1, column 13.

...because of the class name " User ". I assume User is the reserved keyword. When I change my entity name to User_ it works fine.

Do I have to change my entity name? Is there anything else I can do to fix this issue?

Yes, USER is a built-in function in Derby. You'd have to specify a different table name for the JPA entity (usually done via the @Table annotation).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM