This page is no longer maintained — Please continue to the home page at

2.8.0 update mapping problem with javax.persistence.OneToMany

No replies
Joined: 2009-02-26,
User offline. Last seen 2 years 12 weeks ago.

Hi Guys.

Hopefully this is the last of my little problems as I upgrade to work with
2.8.0. I changed:

@OneToMany{val mappedBy="parentObject", val
var models: Set[ChildObject] = new HashSet[ChildObject]

Here we are using java.util.Set and java.util.HashSet to keep a list of
child objects against a parent object.

I updated the annotation to work with 2.8.0:

@OneToMany(mappedBy="parentObject", targetEntity=classOf[ChildObject])
var models: Set[ChildObject] = new HashSet[ChildObject]

and now I am getting the following Hibernate error:

Caused by: org.hibernate.MappingException: Could not determine type for:
java.util.Set, at table: PARENT_OBJECT, for columns:
at org.hibernate.mapping.SimpleValue.getType(
at org.hibernate.mapping.SimpleValue.isValid(
at org.hibernate.mapping.Property.isValid(
at org.hibernate.mapping.PersistentClass.validate(
at org.hibernate.mapping.RootClass.validate(
at org.hibernate.cfg.Configuration.validate(

I am not sure how I need to update my annotation to express this
relationship, or if it is some other part of upgrading to 2.8.0 that I am

Thanks in advance for your help,

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland