Thanks for the quick reply.
I did see that annotations reference guide, and that is actually the one that I found to be lacking. There are way too many details it skips over (like, what is the relevant part of the database schema?).
I am still trying to figure out if Hibernate can do what I need it to do. Part of what I need is for it to be relatively transparent. I don't want to kill too many brain cells on things that should be simple.
For example, I can't seem to get Hibernate to respect my primary key auto_increment property. I have a test class, Person. In my bean I define the identifier thusly:
Code:
@Id
@GeneratedValue
@Column(name="personId")
private Integer id;
My test application simply creates a Person object, and saves it using session.save(..). My database table explicitly sets the primary key to automatically increment:
Code:
create table Person (
`personId` int(11) NOT NULL AUTO_INCREMENT,
...,
PRIMARY KEY (`personId`),
)
If I manually issue SQL to add Person rows (insert into Person;) it does so without complaint, and assigns a new row with a new, unique, incremented primary key in the personId slot.
But when I run my Hibernate test app several times it ignores the auto_increment, and just overwrites whatever was there. It always creates a Person with personId=1.
I can't understand why this is the default behavior, or what I am doing wrong.