-->
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: Hibernate Aditional columns insertion in transaction table
PostPosted: Mon Sep 24, 2012 2:32 am 
Newbie

Joined: Mon Sep 24, 2012 1:22 am
Posts: 2
Tables:
Table A Table B Table A_T_B
A_ID B_ID A_ID
Coulmn2 Columen2 B_ID
Column3 Column3
Pojos :
A.java B.java
Set<B> bb


Type 1: we have already data present in Table B

Annotations are

@ManyToMany(cascade = CascadeType.REFRESH, fetch = FetchType.LAZY)
@JoinTable(name = " A_T_B ", joinColumns = { @JoinColumn(name = "A_ID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "B_ID", nullable = false, updatable = false) })

Commands executed by hibernate:
Insert into Table A
Insert into Table A_T_B

This works fine

Type 2: we don’t have data present in Table B

@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
@JoinTable(name = "A_T_B", joinColumns = { @JoinColumn(name = "A_ID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "B_ID", nullable = false, updatable = false) })

Commands executed by hibernate:
Insert into Table B
Insert into Table A
Insert into Table A_T_B

We are facing problem:

In above two scenarios we are unable to add data , if the transaction table(A_T_B) is having extra columns more than A_ID and B_ID. ...please somebody help on this please?


Top
 Profile  
 
 Post subject: Re: Hibernate Aditional columns insertion in transaction table
PostPosted: Tue Sep 25, 2012 6:27 am 
Newbie

Joined: Mon Sep 24, 2012 1:22 am
Posts: 2
please some one have any inputs?


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.