Problem with HSQLDB & SequenceGenerator
I have an entity which has an ID field:
@Id
@Column(name = "`U##ID_VOIE`")
@GeneratedValue(generator = "VOIE_SEQ")
private String id;
The class has the sequence generator defined as well:
@SequenceGenerator(name = "VOIE_SEQ", sequenceName = "VOIE_SEQ")
and the Oracle schema has the requisite sequence present. Everything works okay.
We also have tests, which uses an in-memory HSQLDB. Before running the tests, all the tables are created based on the Hibernat开发者_运维问答e entity classes.
However the table for this particular class is not being created. And error pops up, because ID is a String and the SequenceGenerator in HSQLDB returns an INT / LONG / Numeric value.
The application is using a legacy Oracle database and ID_VOIE column must remain a String / Varchar.
Any solutions?
Using H2 instead.
精彩评论