Reputation: 2300
I have a domain class name DataList
@Entity
@Table(name = "list_data")
public class ListData {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id")
private int id;
@Column(name = "sys_id")
private String sysId;
@Column(name = "name")
private String name;
@Column(name = "detail")
private String detail;
@Column(name = "values")
private String values;
//getters and setters
}
I have some others domain class.. I'm using hibernate 3.6 everything alright.
but somehow Im unsuccessful while creating this table.
2012-02-25 03:31:52,166 ERROR SchemaExport:274 Unsuccessful: create table list_data (id >integer not null auto_increment, detail varchar(255), name varchar(255), sys_id varchar(255), >values varchar(255), primary key (id)) 2012-02-25 03:31:52,167 ERROR SchemaExport:275 You have an error in your SQL syntax; check the >manual that corresponds to your MySQL server version for the right syntax to use near 'values >varchar(255), primary key (id))' at line 1
I know my hibernate configuration is fine, I have some other domain class, they are working just fine.
Upvotes: 0
Views: 335
Reputation: 21564
I think that you cannot use values
as a column name since it is a MySQL keyword (INSERT INTO ... VALUES() ).
Upvotes: 3