-->
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.  [ 1 post ] 
Author Message
 Post subject: @CollectionId is composite
PostPosted: Thu May 10, 2007 10:49 am 
Newbie

Joined: Sat Jun 03, 2006 5:36 pm
Posts: 8
Hibernate 3.2.3

I've object "Obj" which has Set of constrains "ObjConstrain"

This is fragment of Obj.class
Code:
@org.hibernate.annotations.CollectionOfElements
    @JoinTable(name = "T_OBJECTCONSTRAINT",
            joinColumns = @JoinColumn(name = "OBJECT_ID"))
    @org.hibernate.annotations.CollectionId(
            columns = {@Column(name = "OBJECT_ID"),
                       @Column(name = "CONSTRAIN_TYPE")},
            type = ?????,
            generator=?????
    )
    private Set<ObjConstrain> constraints;


Class ObjConstrain has composite key:

- OBJECT_ID and CONSTRAIN_TYPE, which actually is of specific EnhancedUserType

What to write into CollectionId annotation?[/code]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.