-->
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: Mixing NaturalId with Collection mappings
PostPosted: Mon Nov 09, 2009 4:56 pm 
Newbie

Joined: Mon Feb 23, 2009 11:16 am
Posts: 17
Hi,

I use NaturalIds for all my objects and have recently run into an issue. Some of my objects define their uniqueness through a homogeneous collection of objects. Unfortunately when I map this collection with @ManyToMany as well as @NaturalId then I get the following error:

Caused by: org.hibernate.MappingException: Unable to find logical column name from physical name null in table MyClass
at org.hibernate.cfg.Mappings.getLogicalColumnName(Mappings.java:514)
at org.hibernate.cfg.IndexOrUniqueKeySecondPass.doSecondPass(IndexOrUniqueKeySecondPass.java:61)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1136)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:324)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1121)
...

Which leads me to believe that NaturalId-ing a ManyToMany is simply not supported. Can anyone confirm this? I was unable to find anything on the topic within the Core or Annotations documentation.

If this is not allowed, does anyone have any clever ideas on how I can still make uniqueness based on a set of objects? Although the more I think about it this whole attempt does not sound like something one would like to do in SQL... if that is the answer than I will be willing to accept such an answer.

Thank you.

Apologies if I missed any important information but since my question is pretty general (I hope) I figured details don't matter... pardon me if I am incorrect in my assumption.


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.