-->
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.  [ 3 posts ] 
Author Message
 Post subject: MappedBy from 3.1 to 3.2
PostPosted: Mon Oct 30, 2006 8:59 am 
Newbie

Joined: Tue Aug 01, 2006 4:02 am
Posts: 8
Hi,
I'm currently moving from hibernate 3.1 to 3.2 to comply ejb3 spec etc. On 3.1 everything was working fine, but now I receive this exception:

org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: be.fgov.onerva.hris.bo.IndividualData.rrnr1 in be.fgov.onerva.hris.bo.Agent.individualDataList

I have 2 relational tables, here is the summary :

Code:
COMMON_DATA_INDIVIDUAL{RRNR1,VALUEDATE,...}
COMMON_UNVERSIONABLE_DATA{RRNR1,...}


here are the mapping :

Code:
@Entity
@AccessType("field")
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "COMMON_DATA_INDIVIDUAL")
@IdClass(VersionableDataAgentPk.class)
public class IndividualData implements Serializable {

    @Id
    @ManyToOne
    private Integer rrnr1;

    @Id
    private Date valueDate;


Code:
@Embeddable
@AccessType("field")
public class VersionableDataAgentPk implements Serializable {

    @Basic
    @Column(name = "RRNR1")
    private Integer rrnr1;

    @Basic
    @Column(name = "VALUE_DATE", nullable = false)
    private Date valueDate;


Code:
@Entity @AccessType("field")
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "COMMON_UNVERSIONABLE_DATA")
public class Agent implements Serializable {

    @Id
    @Column(name = "RRNR1")
    private Integer rrnr1;

    @OneToMany(mappedBy = "rrnr1")   
    @JoinColumn(name = "RRNR1")
    @MapKey(name = "valueDate")
    @OrderBy(value = "valueDate")
    private Map<Date, IndividualData> individualDataList;


I try to set the targetEntity in the OneToMany, but that changes nothing...
rrnr1 is well in the IndividualData table... bu it can't find it ???
Any idea ?

Many thanks,
Vince.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 07, 2006 6:27 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
this is not a valid construct
Code:
@Id
@ManyToOne
private Integer rrnr1;

_________________
Emmanuel


Top
 Profile  
 
 Post subject: having the same problem
PostPosted: Mon Jan 29, 2007 11:11 am 
Newbie

Joined: Mon Jan 08, 2007 2:10 pm
Posts: 2
hi im having the same problem - i just noticed i had old hibernate jars and just updated to the latest. heres whats happening:

org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: au.edu.qut.yawl.elements.data.YParameter.decomposition in au.edu.qut.yawl.elements.YDecomposition.inputParameters

heres the exception:

Quote:
org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: au.edu.qut.yawl.elements.data.YParameter.Decomposit
ion in au.edu.qut.yawl.elements.YDecomposition.inputParameters
at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:543)
at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:508)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:43)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1130)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:296)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1286)


my class YDecomposition has these:

Code:
    @OneToMany(mappedBy="decomposition", cascade={CascadeType.ALL}, fetch = FetchType.EAGER)
    @OnDelete(action=OnDeleteAction.CASCADE)
    @Where(clause="direction='inputParam'")
    public List<YParameter> getInputParameters() {
       return _inputParameters;
   }


yparameter extends yvariable which has a getDecomposition() method:
Code:
    @ManyToOne
    public void setDecomposition(YDecomposition parent) {
       this.parent = parent;
    }
   
    public YDecomposition getDecomposition() {
       return parent;
    }


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