Expert |
|
Joined: Tue Dec 28, 2004 7:02 am Posts: 573 Location: Toulouse, France
|
This is a very common mistake : you seem to have specified something like <generator class="assigned"> inside the id tag of Logic.hbm.xml (or nothing 'cause I think this is the default), so your code is missing the setId() part.
If you want Hibernate to take care of this primary key (generating one when none is present : for new objects), use <generator class="native"> and create a sequence named hibernate_sequence in the db if it supports sequence. If not, hibernate should automatically use the right thing (identity, etc.) if you specified the right dialect in you hibernate.cfg.xml file.
_________________ Baptiste
PS : please don't forget to give credits below if you found this answer useful :)
|
|