-->
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.  [ 2 posts ] 
Author Message
 Post subject: Duplicate property mapping
PostPosted: Wed May 20, 2009 6:45 am 
Newbie

Joined: Thu Aug 14, 2008 2:22 am
Posts: 11
hi,
i got the following error: org.hibernate.MappingException: Duplicate property mapping of _sectionTypesBackref found in SectionType.

My class SectionTypes:
Code:
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public abstract class SectionType extends AbstractLongEntity {

    private ContainerSection parentContainerSection;
    private int orderNo;

    @ManyToOne
    @JoinColumn(name="parent_container_section_id", insertable = false, updatable = false, nullable=false)
    @ForeignKey(name = "section_type_fk_container_section")
    public ContainerSection getParentContainerSection() {
        return this.parentContainerSection;
    }

    public void setParentContainerSection(ContainerSection parentContainerSection) {
        this.parentContainerSection = parentContainerSection;
    }

   @Column(insertable = false, updatable = false)
    public int getOrderNo() {
        return this.orderNo;
    }

    public void setOrderNo(int orderNo) {
        this.orderNo = orderNo;
    }
...


AbstractLongEntity contains only an id.

My class ContainerSection:
Code:
@Entity
public class ContainerSection extends SectionType {

    private List<SectionType> sectionTypes = new ArrayList<SectionType>(0);

    @OneToMany
    @JoinColumn(name="parent_container_section_id", nullable=false)
    @IndexColumn(name = "orderNo")
    public List<SectionType> getSectionTypes() {
        return this.sectionTypes;
    }

    public void setSectionTypes(List<SectionType> sectionTypes) {
        this.sectionTypes = sectionTypes;
    }


does anyone have an idea, what i can do? thanks in advance.


Top
 Profile  
 
 Post subject: Re: Duplicate property mapping
PostPosted: Fri May 22, 2009 6:52 am 
Newbie

Joined: Thu Aug 14, 2008 2:22 am
Posts: 11
I got it. For everyone who is interested in the solution, see this link:
http://jsweetland.livejournal.com/2475.html


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