-->
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: Best way to creating mapping docs based upon these tables
PostPosted: Wed Sep 29, 2004 11:52 am 
Newbie

Joined: Tue Sep 28, 2004 2:34 pm
Posts: 2
I have three tables (below). I'm having a problem conceptualizing how to map the METRICS table such that I can do the included query...it doesn't seem as though it should be it's own class, so I would think that there would be a way to reference it in another manner w/in a mapping for the cust_totals or totals_desc. New to this, so open to references to other forum posts, outside docs, etc. (yes, picked up Hibernate in Action as well). I did a search and didn't see anything that seemed to be applicable. (Want to do this as "correct" as possible, so I don't want any naivete to cause me to miss something, hence, the reluctant post)

TIA
Code:

(column name;type;length)

Metrics
=====
CSTTOT_KEY;char;3

Cust_Totals
==========
CST_CODE;char;20
CSTTOT_KEY;char;3

totals_desc
=======
CSTTOT_KEY;char;3
LNGCODE;char;4
CSTTOT_LIB;char;30


that I wish to do the following query on:

Code:
Select L.CSTTOT_LIB as LIB,C.CSTTOT_VALUE as VAL From CUST_TOTALS C Join TOTALS_DESC L
    On C.CSTTOT_KEY = L.CSTTOT_KEY Join METRICS G On G.CSTTOT_KEY=C.CSTTOT_KEY Where
    LNGCODE='850 ' And CST_CODE='123456789'


Customer_totals can have cst_codes like ABC, XYZ, MNO, JKL. Metrics is a subset, say, just XYZ and MNO. Totals_desc has the i18n descriptions of all the codes, even those not in customer_totals.

And, if it helps, using an established DB design and MS SQL


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.