Skip to content
Advertisement

hibernate h2 embeddable list expected “identifier”

I’m trying to associate a list of function (whom Embeddable) within my Employee Entity and H2 seems unhappy with this saying that it expected an “identifier”

Caused by: org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement ” CREATE TABLE EMPLOYEE_FUNCTIONS ( EMPLOYEE_EMPLOYEEID VARCHAR(255) NOT NULL, ACTIVE BOOLEAN NOT NULL, DEPARTMENTNUMBER INTEGER NOT NULL, DESCRIPTION VARCHAR(255), ORDER[*] INTEGER NOT NULL ) “; expected “identifier”;

The thing is I already done that with an other project and I don’t see why it doesn’t work.

Employee.java

JavaScript

Function.java

JavaScript

I removed a few properties in Employee that wasn’t necessary. What may cause this error? Is it because I have a String as identifier in my Employee? If so how can I tell to Hibernate to add Employee_EmployeeID as identifier? Thanks

Advertisement

Answer

Turns out I was being dumb and named a column “Order”. Wonder why H2 wasn’t happy :upside_down:

Changed the variable name to something else and it worked!

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement