Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 629
Pinchy Avatar asked Apr 23 '13 05:04

Pinchy


1 Answers

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).

like image 63
Vineet Reynolds Avatar answered Oct 21 '22 03:10

Vineet Reynolds