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: Multiple ManytoOne mappings, join column
PostPosted: Tue Nov 29, 2011 12:44 am 
Newbie

Joined: Tue Nov 29, 2011 12:42 am
Posts: 3
In my code I am using two ManytoOne mappings as follows:

@JoinColumn(name = "Prompt_id", referencedColumnName = "Id", nullable = false)
@ManyToOne(optional = false)
private Prompt promptid;
@JoinColumn(name = "Variable_id", referencedColumnName = "Id", nullable = false)
@ManyToOne(optional = false)
private Variable variableid;

Prompt and Variable are tables with PK as Id in both. I am using them in a CallFlowMaster entity where Prompt_id and variable_id fields are FKs referencing Prompt and Variable PKs respectively.
While starting server I get following execption:
Caused by: org.hibernate.MappingException: Unable to find column with logical name: Id in org.hibernate.mapping.Table(Prompt) and its related supertables and secondary tables
at org.hibernate.cfg.Ejb3JoinColumn.checkReferencedColumnsType(Ejb3JoinColumn.java:396)
at org.hibernate.cfg.BinderHelper.createSyntheticPropertyReference(BinderHelper.java:102)
at org.hibernate.cfg.ToOneFkSecondPass.doSecondPass(ToOneFkSecondPass.java:88)
at org.hibernate.cfg.AnnotationConfiguration.processEndOfQueue(AnnotationConfiguration.java:456)
at org.hibernate.cfg.AnnotationConfiguration.processFkSecondPassInOrder(AnnotationConfiguration.java:438)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:309)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1148)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:1226)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:173)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:854)
at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:425)
at org.hibernate.


Pls help.
Best Regards
Jaskiran]


Top
 Profile  
 
 Post subject: Re: Multiple ManytoOne mappings, join column
PostPosted: Tue Nov 29, 2011 7:33 am 
Newbie

Joined: Thu Jan 27, 2011 10:53 am
Posts: 12
Hi,
Sounds like you miss to map table Prompt or the column Id has another name in your mapping.
Hope it helps


Top
 Profile  
 
 Post subject: Re: Multiple ManytoOne mappings, join column
PostPosted: Tue Nov 29, 2011 7:38 am 
Newbie

Joined: Tue Nov 29, 2011 12:42 am
Posts: 3
yeah, solved it soon after I posted :). Thanks!


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.