-->
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: one-to-one implementation question, plz help
PostPosted: Fri Aug 25, 2006 5:08 am 
Newbie

Joined: Tue Aug 22, 2006 5:26 am
Posts: 10
Location: Pakistan
Hi All members,

The Scenerio:
**I have two tables, UserAccount and Businees, UserAccount has a forign key businessId from Business, (1 user always has 1 business).
**I have a signup form in which I have to insert data in these both tables.

hbm Mapping doc for UserAccount is here:


Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Aug 24, 2006 3:14:23 PM by Hibernate Tools 3.1.0.beta5 -->
<hibernate-mapping>
   <class name="tyn.cm.hibernate.UserAccount" table="userAccount"
      schema="dbo" catalog="YellowNumber">
      <id name="userId" type="long">
         <column name="userID" />
         <generator class="assigned" />
      </id>
      <property name="businessId" type="string">
         <column name="businessID" length="36" />
      </property>
      <property name="userName" type="string">
         <column name="userName" length="36" not-null="true"
            unique="true" />
      </property>
</class>
</hibernate-mapping>


Issue:
I m new 2 hibernate n I wana know how I will bind my userId with businessId and how I code such method or I be provided by Hibernate tht I can insert data in both tables.

also want to know whn I have the case many-to-many and one-to-many case.

If u have any tutorial for that or u want to help directly, plz do that

Lookig for ur help

rgd

_________________
Tahir


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.