Today I stumbled over this bug again in hibernate 4.3.5. This time I tried the test case given in the bugreport:
@Entity
public class Foo {
@Id @GeneratedValue privateInteger id;
@ElementCollection
private List<Bar> bars;
}
@Embeddable
public class Bar {
privateString name;
}
This setup results in the following error
Hibernate: create table Foo (id int not null, primary key (id))
Hibernate: create table Foo_bars (Foo_id int not null, bars_collection&&element_name varchar(255))
2014-07-01 12:21:03,340 ERROR org.hibernate.tool.hbm2ddl.SchemaExport - HHH000389: Unsuccessful: create table Foo_bars (Foo_id int not null, bars_collection&&element_name varchar(255))
2014-07-01 12:21:03,340 ERROR org.hibernate.tool.hbm2ddl.SchemaExport - Incorrect syntax near '&'.