-->
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.  [ 5 posts ] 
Author Message
 Post subject: Collection Mapping Not Working
PostPosted: Fri May 26, 2006 11:12 am 
Newbie

Joined: Fri Jul 30, 2004 3:11 pm
Posts: 18
I have two projects. In one, we used the tools to generate the annotations (had been using a prior version of Hibernate), and the graph works. In the second one, collection-based mappings don't work, causing these kinds of errors:

applicationContext.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: org.hibernate.MappingException: Could not determine type for: java.util.Set, for columns: [org.hibernate.mapping.Column(medicalConditions)]
Caused by: javax.persistence.PersistenceException: org.hibernate.MappingException: Could not determine type for: java.util.Set, for columns: [org.hibernate.mapping.Column(medicalConditions)]
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:217)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114)

I just finished upgrading to the latest releases of the whole stack; nothing changed.

Could not determind type for java.util.Set????


Top
 Profile  
 
 Post subject: More info:
PostPosted: Fri May 26, 2006 11:22 am 
Newbie

Joined: Fri Jul 30, 2004 3:11 pm
Posts: 18
@OneToMany(cascade = { CascadeType.ALL }, fetch = FetchType.EAGER)
@JoinColumn(name="patientId")
public Set<MedicalCondition> getMedicalConditions() {
return medicalConditions;
}

public void setMedicalConditions(Set<MedicalCondition> conditions) {
this.medicalConditions = conditions;
}


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 26, 2006 12:02 pm 
Newbie

Joined: Fri Aug 13, 2004 12:49 pm
Posts: 10
Try using a @OneToMany(mappedBy="??????") since this relationship should depend on a foreign key mapped in the MedicalCondition class.


Top
 Profile  
 
 Post subject: No Cigar
PostPosted: Fri May 26, 2006 2:59 pm 
Newbie

Joined: Fri Jul 30, 2004 3:11 pm
Posts: 18
Same error. Thanks for the idea though.


Top
 Profile  
 
 Post subject: give it a try
PostPosted: Wed May 31, 2006 10:29 am 
Newbie

Joined: Tue Jan 04, 2005 4:05 am
Posts: 8
-->> Could not determine type for: java.util.Set, for columns: [org.hibernate.mapping.Column(medicalConditions)]

The Line above might be because the container couldn't recognize the type of MedicalCondition in the Set, so try the following:

@OneToMany(targetEntity=MedicalCondition.class)

Also, check if MedicalCondition has the @Entity And implements the Serializable interface

@Entity
class MedicalCondition implements Serializable{
...

}


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

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.