Is there a way I can manage or change the Hibernate 5 generated sql for how the sequence is retrived from AS400 DB2? Or revert it to use the Hibernate 4 SQL?
I have a Entity mapped as follows:
@Id
@Column(name = "D")
@SequenceGenerator(
name = "art_id_gen",
sequenceName = "G_ID_SEQ",
allocationSize = 1)
@GeneratedValue(generator = "art_id_gen", strategy = GenerationType.SEQUENCE)
private long id;
When I use Hibernate 4 the SQL is (which works):
values nextval for G_ID_SEQ;
but when ussing Hibernate 5 the SQL is (which doesn't work):
select next_val as id_val from G_ID_SEQ for update with rs;
I'm using the org.hibernate.dialect.DB2400Dialect
Anyone have some input or suggestion how to fix this?