Entity example:
{code:java} @Entity(name = "Flour") @Table(name = "Flour") public static class Flour { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; ... }{code}
and setting
{noformat}hibernate.jdbc.use_get_generated_keys = false{noformat}
It will produce the following invalid query with Sql Server:
{code:sql}insert into Flour (description,name,type) values (?,?,?) returning id{code}
instead of ( ORM 5.6.14)
{code:sql}insert into Flour (description, name, type) values (?, ?, ?) select scope_identity(){code}
or
{code:sql}insert into Flour (description, name, type) output inserted.id values (?, ?, ?){code} |
|