Hib just ignoring an id setting if that strategy take a place.
Are there any ways to avoid that and save the strategy?
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "id")
public Long getId() {
return id;
}
...
Account account = new Account();
account.setId(1000L);
account.setSmth(smth);
...
//Tried to do so, but tomcat hangs on this string.
session.createSQLQuery("ALTER TABLE account AUTO_INCREMENT = " + account.getId() + ";").executeUpdate();
session.save(account);
...
Spasibo!