[hibernate-issues] [Hibernate-JIRA] Updated: (ANN-609) Need a way to specify "unsaved-value" strategy using annotations

Christian Bauer (JIRA) noreply at atlassian.com
Thu May 3 22:07:04 EDT 2007


     [ http://opensource.atlassian.com/projects/hibernate/browse/ANN-609?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Bauer updated ANN-609:
--------------------------------

      Priority: Minor  (was: Major)
    Issue Type: New Feature  (was: Bug)

> 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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list