Hi,
I am experiencing some problems with a Structure that looks like the following:
Article has Set<Topics> has Set<Item>
I am assigning the IDs myself, they're strings. However, I try to saveOrUpdate the final article and cascade the Topics and Items down. There is however one problem - some topics might include the same items - that's when I get the Following error:
a different object with the same identifier value was already associated with the session: [com.headcaselabs.nlp.wiki.entities.Item#Titanic]
I would appreciate any recommendations... sorry for posting previously related things - I think however that I have narrowed the problem down and this here is more specific!
Thanks!
[code]
class Article implements Serializable{
String name;
Set<Topic> topic;
@Id @Column(columnDefinition=" varbinary(255) NOT NULL")
String getName() {..}
void setName(..
@ManyToMany(cascade=CasacadeType.ALL)
Set<Topic> getTopic() {..}
setTopic...
}
class Topic implements Serializable{
String name;
Set<Item> items;
@Id @Column(columnDefinition=" varbinary(255) NOT NULL")
String getName() {..}
void setName(..
@ManyToMany(cascade=CasacadeType.ALL)
Set<Item> getItems() {..}
setItems...
}
class Item implements Serializable {
public String name;
@Id @Column(columnDefinition=" varbinary(255) NOT NULL")
String getName() {..}
void setName(..
}
[/code]
|