[
http://opensource.atlassian.com/projects/hibernate/browse/ANN-609?page=co...
]
Suji Suresh commented on ANN-609:
---------------------------------
Why is this a new feature and not a bug? I think this is a bug because Hibernate does
support this feature plus there is a way to specify "unsaved-value" via the
mapping file. There is a way to specify "unsaved-value" via xdoclet in
Hibernate2. My project just migrated to Hibernate3/annotations and now all of a sudden the
functionality is broken.
Need a way to specify "unsaved-value" strategy using
annotations
----------------------------------------------------------------
Key: ANN-609
URL:
http://opensource.atlassian.com/projects/hibernate/browse/ANN-609
Project: Hibernate Annotations
Issue Type: New Feature
Environment: Hibernate 3.2.2, Hibernate-annotations 3.2.1
Reporter: Suji Suresh
Priority: Minor
Hibernate has two ways of specifying a value for primary key:
1. Assign a value before handing it over to Hibernate
2. Have Hibernate generate the value before persisting
In my project I have objects of both of the above specified types. In other words I
assign value for the primary key for some the objects (lets call these objects
"assigned") and for others I have Hibernate generate the value before persisting
(lets call these objects "generated"). Since Hibernate annotations does not
support "unsaved-value", I do not have a way of specifying
"unsaved-value" strategy. While my "generated" objects work perfectly
with Hibernate's default "unsaved-value" strategy, I see wrong (but
expected) behaviour when I try to persist an "assigned" object that is already
present in the database in that, I get StaleStateException instead of
DataIntegrityViolationException
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira