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