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: Question in hibernate one to many relation.
PostPosted: Thu Aug 25, 2005 3:24 am 
Newbie

Joined: Fri Apr 22, 2005 12:34 am
Posts: 4
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.05

I am now working on a legacy database(MS SQLSERVER 2000).

I have two tables, They are one-to-many relation.

CREATE TABLE [FSICOLUMNSETTING] (
[OBJECTID] [int] NOT NULL ,
[CLASSID] [int] NOT NULL ,
[NAME] [varchar] (255) NULL ,
[DESCRIPTION] [varchar] (255) NULL ,
[CREATED] [datetime] NULL ,
[LASTMODIFIED] [datetime] NULL ,
[OWNERID] [int] NULL ,
[LASTMODIFIEDBY] [int] NULL
)

CREATE TABLE [FSICOLUMNSETTINGENTRY] (
[OBJECTID] [int] NOT NULL ,
[CLASSID] [int] NOT NULL ,
[NAME] [varchar] (255) NULL ,
[DESCRIPTION] [varchar] (255) NULL ,
[CREATED] [datetime] NULL ,
[LASTMODIFIED] [datetime] NULL ,
[OWNERID] [int] NULL ,
[LASTMODIFIEDBY] [int] NULL ,
[COLUMNSETTINGNAME] [varchar] (255)NULL ,
[COLUMNINDEX] [int] NULL ,
[COLUMNNAME] [varchar] (50)NULL ,
[SCENARIONAME] [varchar] (50)NULL ,
[PREPAYMODELMATRIXNAME] [varchar] (50) NULL
)

We know Hibernate use the parent's id to relate the child's FK.

But in the legacy database, it use the parent table(FSICOLUMNSETTING) 's unique field "NAME" to relate the child table(FSICOLUMNSETTINGENTRY) 's field "COLUMNNAME".

The two tables can be maped to the one-to-many relation?

How to do?

Regards


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 25, 2005 6:18 am 
Newbie

Joined: Fri Apr 22, 2005 12:34 am
Posts: 4
Does anybody have met the same case.


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.