-->
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: must "one" side of many-to-one be a mapped object
PostPosted: Tue Jan 11, 2005 10:36 am 
Newbie

Joined: Mon Nov 15, 2004 1:42 pm
Posts: 11
If I have a many to one unidirectional association. Does the one side of the association need to be a mapped object? Or can it be of some other type?

IOW, is this ok?


Code:
Class User
Long id
String name
Long centerID
...

Class Center
Long id
String name

User.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN"   "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

... mappings ...

    <many-to-one name="centerId"  column="CENTER_ID" cascade="none" not-null="true"  />
 
.... other mappings


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.