-->
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.  [ 3 posts ] 
Author Message
 Post subject: Creating mappings.
PostPosted: Wed Nov 01, 2006 4:50 am 
Beginner
Beginner

Joined: Mon Oct 30, 2006 12:46 am
Posts: 26
Hi,


I am new to hibernate.


Here i am trying to create relationship between two tables.



BranchBean.hbm.xml for Branch table:
-----------------------

<hibernate-mapping>

<class name="com.cisco.hotice.beans.BranchBean" table="Branch">
<id name="branchId" column="Branch_Id">
<generator class="native"/>
</id>
<property name="branchName" column="BranchName" />
</class>


CommandBean.hbm.xml for Command Table :
--------------------------------------------
class name="com.cisco.hotice.beans.CommandBean" table="Command">
<id name="commandId" column="Command_id">
<generator class="native"/>
</id>
etc.....
</class>

These are two separate xml files , now i want to create one table Branch_command , but these table should be like:

Branch_command:
--------------------
Branch_Id
Command_Id(refers to command_Id in command table) Finally it will become FK in the table.
Component_ID


Could any one hepl me how to create relationship among these tables, so that i can create association/mapping .


Pls pls help me .

Thanks In advance.
Praveen


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 01, 2006 6:38 am 
Beginner
Beginner

Joined: Fri Oct 20, 2006 8:02 am
Posts: 36
Hi.

Take a look at the documentation, it is good. http://www.hibernate.org/5.html#A17

And for very fast using, http://www.xylax.net/hibernate/
but it is a little incomplete.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 01, 2006 7:07 am 
Beginner
Beginner

Joined: Mon Oct 30, 2006 12:46 am
Posts: 26
Hi ,

Here i found that they are creating table as normal ( create table table_name) , can we create tables like that and insert the data into it ?

What i thought is i should create tables using hibernate.

i will try to create table as normal i will try to insert the data.



pls correct me if i am doing wrong.

Thanks
Praveen.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.