-->
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: Identify OneToOne Relationship Between tables in FreeMarker
PostPosted: Fri Apr 03, 2009 9:25 am 
Newbie

Joined: Fri Apr 03, 2009 9:10 am
Posts: 1
We are using
pojo = PojoClass
c2j = Cfg2JavaTool
c2h = Cfg2HbmTool
for writing freemarker templates in our project.

Requirement : Generate POJOs with JPA annotations from reading the Database.
We require to identify OneToOne relationships between tables.
However in c2h we can only find methods relating to ManyToOne,OneToMany and ManyToMany and they are working fine.

    Is there a way to find OneToOne Relationship?
    If the foreign key of one table is unique and is associated with another table.This means OneToOne. So can we find this using the methods in c2j,c2h or pojo? pojo.generateAnnTableUniqueConstraint() generates the constraint in the pojo which has the foreignkey but how can the other associated table detect the same?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 15, 2009 8:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
what version are you using?

c2h has a isToOne method in the later versions.

_________________
Max
Don't forget to rate


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.