These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: identifier of an instance of XX was changed from 1 to 20
PostPosted: Tue Dec 20, 2011 9:59 pm 
Newbie

Joined: Wed Jul 27, 2011 3:50 pm
Posts: 2
Hi All,
I'm running into an odd issue when I try to get persisted my entities, this is the case:

@Entity
@Table(name = "school_application")
@AttributeOverride(name = "id", column = @Column(name = "school_application_id"))
SchoolApplicationBO extends BO{

..... Other properties

@ManyToOne
@JoinColumn(name = "deg_type_id")
private DegreeTypeBO degree;

.. Getters and setters
}

@Entity
@Table(name = "degree_type_cd")
@AttributeOverride(name = "id", column = @Column(name = "deg_type_id"))
public class DegreeTypeBO extends BO {

..... Other properties

@Column(name = "name")
private String name;

.. Getters and setters
}

When in my jsp I tried to change the degreeTypeDTO already associated to my SchoolApplicationDTO I get:

org.hibernate.HibernateException: identifier of an instance of com.talend.bo.DegreeTypeBO was altered from 1 to 20
at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:85)
at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:190)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:147)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:58)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1175)
....

So, I'm not able to modify the degreeType that has assigned my schoolApplication.

Could any of you help me with that issue?

PD: I'm using: Hibernate: 3.5.4-Final and Spring 3.0.5.RELEASE

Thanks in advance.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.