-->
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.  [ 5 posts ] 
Author Message
 Post subject: how to use many to one mapping
PostPosted: Thu Sep 17, 2009 4:21 am 
Beginner
Beginner

Joined: Mon Sep 14, 2009 9:29 am
Posts: 30
hi all..I have totally three table Loanproposal,BankLoanProposal,Bankmaster in banking project.

Relationship:

LoanProposal 1--->* BankLoanProposal
LoanProposal 1--->1 Bankmaster

key:
Bankmaster(Bankid is pk) --->LoanProposal(Bankid is fk refering to Bankmaster)

Problem is:
I have many to one relationship between LoanProposal and Bankmaster.So When try to insert in Loanproposal table and
BankLoanProposal alone without inserting in Bankmaster table.It shows NullPointerException in place of Bankid in Loanproposal ..So can please tell me how to insert in Loanproposal table with already existing value of bankid..


Top
 Profile  
 
 Post subject: Re: how to use many to one mapping
PostPosted: Thu Sep 17, 2009 5:29 am 
Beginner
Beginner

Joined: Sat Aug 01, 2009 5:28 am
Posts: 42
you are using bi-directional or uni-directional
if bi-diretional u can load the Bankmaster object than update the both side link.

more over post ur mappings to make it more clear

_________________
Warm Regards,
Tarun Walia


Top
 Profile  
 
 Post subject: Re: how to use many to one mapping
PostPosted: Thu Sep 17, 2009 10:19 am 
Beginner
Beginner

Joined: Mon Sep 14, 2009 9:29 am
Posts: 30
thanks for your reply..I have solved my problem..Thank you very much


Top
 Profile  
 
 Post subject: Re: how to use many to one mapping
PostPosted: Fri Sep 18, 2009 4:01 am 
Beginner
Beginner

Joined: Sat Aug 01, 2009 5:28 am
Posts: 42
great dude
you can also post the solution to let us know how u have done that
may be you have done something very good or may be....

_________________
Warm Regards,
Tarun Walia


Top
 Profile  
 
 Post subject: Re: how to use many to one mapping
PostPosted: Fri Sep 18, 2009 6:31 am 
Beginner
Beginner

Joined: Mon Sep 14, 2009 9:29 am
Posts: 30
I HAVE JUST set insert=false update=false in one table ie in LoanPropsal table


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