Hibernate version:3.2
Hi
I am running a couple of JUnit tests to try out Hibernate Annotations but the generated ID's for my database inserts never reset. I can insert a row, then delete it from the database and when I run the JUnit test again Hibernate will auto increment the last id value (instead of starting at 1 again). Can it have something to do with me never setting the hibernate.hbm2ddl.auto value in hibernate.cfg.xml ?
Code:
private long id;
@Id
@GeneratedValue
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
Code:
public void testInsertEntry() {
openSession();
beginTransaction();
Person person = new Person("Pancakes");
save(person);
endTransaction();
closeSession();
factory.close();
}
Code:
Code: