-->
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: @AttributeOverride help
PostPosted: Tue Dec 16, 2008 5:05 pm 
Newbie

Joined: Mon Jun 18, 2007 2:08 pm
Posts: 10
Hibernate version:
3.2 GA

Mapping documents:
http://www.hibernate.org/hib_docs/annot ... ml_single/

Code between sessionFactory.openSession() and session.close():
N/A

Full stack trace of any exception that occurs:
DuplicateMappingException: Duplicate collection role mapping

Name and version of the database you are using:
N/A ((Bootstrap error)

The generated SQL (show_sql=true):
N/A (Bootstrap error)

Debug level Hibernate log excerpt:


Folks,

I am getting the error Duplicate collection role mapping, an exeption that is being thrown during the boostrap process. (DuplicateMappingException).
I have searched all the forums and mailing lists to no avail on this problem. The closest I could find on this error was actually a duplication of mapping on hibernate, which is not my case.

Here is how it happens.

I have a class in a project that runs by itself, and the following annotations:

@Entity
@Table(name="TABLE_A")
@MappedSuperClass
Class Base
{

Clollection<? extends Foo> someCollection;


@OneToMany(targetEntity=Foo.class)
public Collection<? extends Foo> getCollection() {...}
public void setCollection(Collection<? extends Foo> c) {...}
}


===== On anther level, I have

@Entity
@Table(name="TABLE_A")
@AttributeOverride(name = "someCollection", column = @Column(name = "FOO_ID"))
Class Other extends Base
{



@OneToMany(targetEntity=AFoo.class)
@Override
public Collection<? extends Foo> getSomeCollection() {...}

public void setSomeCollection(Collection<? extends Foo> c) {...}
}

On hinernate.cfg.xml, ther e is only one entry mapping for Other.class and one for AFoo.class


I am not sure why I am getting the duplicate mapping.

Any help is greatly appreciated.

Thank you in advance,

Harringf


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.