Hello,
Right after persist() call hibernate does sequence retrieval from database - totally understood by me.
I just didn't included that sql in logs. Later on commit() I have insert and immediate update.
I've also tried without sequences manually setting id - on commit() occurs insert and update.
If any more information are required please let me know.
I'm attaching my Agent entity code:
Code:
@Entity
@Table(name = "AGENT", uniqueConstraints = {@UniqueConstraint(columnNames = {"NAME"})})
public class Agent {
@Id
@Column(name = "ID", nullable = false)
private long id;
@Column(name = "NAME", length = 32, nullable = false)
private String name;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}