-->
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: Persist n associations between two classes.
PostPosted: Mon Apr 28, 2008 6:45 am 
Newbie

Joined: Wed Apr 23, 2008 6:07 am
Posts: 5
Hello,
I have one problem persiting this two relations one-to-many :
Code:
public class Library {
    //...

    @OneToMany
    public Map<BookPK, Book> getOwnerBooks() {
        return ownerBooks;
    }

    @OneToMany
    public Map<BookPK, Book> getCurrentBooks() {
        return currentBooks;
    }

    //...
}


Hibernate create only one table for two relations with not nullable columns, and not is possible insert only one element for one relation. ( for example i only want insert one owner book).

I try set @Column(nullable=true) under @OneToMany but hibernate ignores this sentence.

Are possible create only one table for relation? or are possible set nullable relation ?

Thks!!

PD: Sorry for my bad English :S.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 29, 2008 9:22 am 
Newbie

Joined: Wed Apr 23, 2008 6:07 am
Posts: 5
hello,
i was blocked with this and had simple solution. Wrote manually different names for every association, this creates different tables.

Sorry! :)


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.