-->
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: EntityType.isOneToOne() not working
PostPosted: Fri Sep 04, 2009 11:57 pm 
Newbie

Joined: Fri Sep 04, 2009 11:47 pm
Posts: 1
I have a POJO with the following annotations on a field:
Code:
@OneToOne(cascade=CascadeType.ALL)
@JoinColumn(name="OneToOneID")
protected SampleBean1 oneToOne;


Note that the POJO is a SampleBean1, so it's basically pointing to the same class. When I get the ClassMetadata and get the oneToOne property's type and cast it to EntityType, EntityType.isOneToOne() returns false. Am I doing something wrong? It is actually quite important for my library to know a OneToOne from a ManyToOne. Is that information stored elsewhere? Hopefully I don't have to use reflection, or worse, look at the SQL for a unique constraint.

More details at http://stackoverflow.com/questions/1381 ... ytoonetype. Sorry to double post on two forums. It's quite an urgent issue for me.

Any help is appreciated.


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.