-->
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: unique-key and annotations
PostPosted: Fri Jan 09, 2009 11:20 am 
Newbie

Joined: Fri Jan 09, 2009 11:05 am
Posts: 3
I am converting from Hibernate hbm files to JPA/Hibernate Annotations
I have the following

<many-to-one name="serviceCode" class="crown.core.types.FacilityServicesType" lazy="false" >
<column name="SERVICE_TYPE" unique-key="UNIQUE_KEY_SVCS">
<comment>Facility service code</comment>
</column>
</many-to-one>

I have problem to define unique-key in annotations.

I did the following:

@ManyToOne(fetch=FetchType.EAGER)
@JoinColumn(name="SERVICE_TYPE")
private FacilityServicesType serviceCode;

How should I define unique-key here?

Thanks for help


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 10, 2009 10:34 pm 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
The <column> element roughly equates to the @Column annotation, so have a look there:

http://www.hibernate.org/hib_docs/annot ... ntity.html

_________________
Chris Bredesen
Senior Software Maintenance Engineer, JBoss


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.