-->
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.  [ 4 posts ] 
Author Message
 Post subject: Duplicate Backref
PostPosted: Mon Sep 11, 2006 11:39 pm 
Regular
Regular

Joined: Sun Oct 26, 2003 9:02 pm
Posts: 90
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.1.3

Mapping documents:

<hibernate-mapping>
<class name="ClassA" lazy="false">
<list name="attributes" lazy="true" cascade="all-delete-orphan" inverse="false">
<key column="object_id" not-null="true"/>
<index column="order_seq"/>
<one-to-many class="ve.com.tcs.process.to.AttributeTo"/>
</list>
</class>
</hibernate-mapping>

<hibernate-mapping>
<class name="ClassB" lazy="false">
<list name="attributes" lazy="true" cascade="all-delete-orphan" inverse="false">
<key column="object_id" not-null="true"/>
<index column="order_seq"/>
<one-to-many class="ve.com.tcs.process.to.AttributeTo"/>
</list>
</class>
</hibernate-mapping>

Full stack trace of any exception that occurs:

org.hibernate.MappingException: duplicate property mapping: _attributesBackref

at org.hibernate.mapping.PersistentClass.checkPropertyDuplication(PersistentClass.java:414)

at org.hibernate.mapping.PersistentClass.validate(PersistentClass.java:404)

at org.hibernate.mapping.RootClass.validate(RootClass.java:192)

at org.hibernate.cfg.Configuration.validate(Configuration.java:984)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1169)

at ve.com.tcs.process.bf.ProcessBf.<init>(ProcessBf.java:139)

at ve.com.tcs.process.bf.ProcessBf.<clinit>(ProcessBf.java:119)

at _organizationUnit._jspService(organizationUnit.jsp:5)

at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)

at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350)

at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)

at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)

at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)

at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)

at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)

at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)

at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)

at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)

at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)

at java.lang.Thread.run(Thread.java:534)


Name and version of the database you are using:Oracle10g release 2

I have an ATTRIBUTES table where I store additional attributes for other tables. I'm trying to map the relationship in two classes and I get Duplicate Backref


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 14, 2006 2:20 am 
Regular
Regular

Joined: Sun Oct 26, 2003 9:02 pm
Posts: 90
Repost


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 16, 2006 12:48 pm 
Regular
Regular

Joined: Sun Oct 26, 2003 9:02 pm
Posts: 90
repost


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 16, 2006 2:05 pm 
Newbie

Joined: Wed Oct 05, 2005 3:36 am
Posts: 15
I think that the problem is that your child class (AttributeTo) is a member of two different lists.

Hence it could have a different index for each of the lists.
Therefore you need seperate index columns for each of the lists:


<index column="order_seq_a"/>

....


<index column="order_seq_b"/>


Note: There may be other issues with the configuration I would strongly suggest that you don't reference the same child from two different lists.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.