-->
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: Foreign Key
PostPosted: Fri Jan 04, 2008 1:09 pm 
Newbie

Joined: Fri Jan 04, 2008 1:01 pm
Posts: 2
Ich habe eine Tabelle Ticket und eine Tabelle Status, jedes Ticket hat einen Status. Die statusId ist nun ein Fremdschlüssel der Tabelle Status. Mit welchen Annotations kann ich dies in Hibernate markieren, so dass nur eine statusId aus der Tabelle Status zugelassen wird? - Die Suchfunktion des Forums, sowie die Annotation @ForeignKey brachte mich leider nicht zum Ziel.

Tabelle Ticket
ticketId, ticketText, statusId

@Id
@GeneratedValue
@Column(name = "ticketId")
private Integer ticketId;

@Column(name = "ticketText")
private Integer ticketId;

@Column(name = "statusId")
private Integer statusId;


Tabelle Status
statusId, text



Besten Dank für jegliche Hinweise.

mfg
snake


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 08, 2008 1:48 pm 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
Hallo,

ich gebe Dir ein paar Stichwörter zum Suchen in der Hibernate Referenz. Das sollte weiterhelfen:
Relation/Association/Collection/ManyToOne Annotation

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


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.