[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5814) set entity id for auto-generated id annotation

Gail Badner (JIRA) noreply at atlassian.com
Mon Jan 3 15:08:05 EST 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5814?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=39471#action_39471 ] 

Gail Badner commented on HHH-5814:
----------------------------------

Dave, what Hibernate version are you using? Why are you setting the entity version to null in the data source B?

> set entity id for auto-generated id annotation
> ----------------------------------------------
>
>                 Key: HHH-5814
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5814
>             Project: Hibernate Core
>          Issue Type: Bug
>         Environment: ALL
>            Reporter: Dave
>
> We need to copy data from one data source to another, and need keep same id to keep entity relations.
> 1. fetch entities from data source A
> 2. evict entities from session, set version to null, keep id not changed.
> 3. create entities in data source B.
> for @GeneratedValue(strategy = GenerationType.AUTO), entity id is reset by Hibernate.
> But for auto increment id in mysql, it can be set manually and AUTO_INCREMENT is automatically adjusted.

-- 
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