No prob...
Ouch! That worries me that the DBAs wouldn't let you add a PRIMARY KEY?!? to a table! You can tell if you have a primary key by querying the user_constraints view.
Code:
SELECT *
FROM user_constraints
WHERE constraint_type = 'P' AND table_name = 'FCT_HISTORY';
Check out:
http://asktom.oracle.com/pls/ask/f?p=49 ... 0828234131I'm not sure, personally, if you can do what you want to do without a PK. That's best answered by the Hibernate developers.
BTW, Download a trial of Toad for Oracle for its autoformat capabilities... e.g.
Code:
SELECT *
FROM (SELECT metricsent0_.per_id AS per1_, metricsent0_.mkt_pos_id AS mkt2_,
metricsent0_.loc_id AS loc3_
FROM admet_promo_per_history metricsent0_,
(SELECT per_id, per_level_name,
CASE
WHEN (per_level_name = 'ADVERTISING WK'
)
THEN ad_wk_begin_dt
WHEN (per_level_name = 'SCANNING WK')
THEN scan_wk_begin_dt
WHEN (per_level_name = 'PROMO PLAN PERIOD')
THEN promo_per_begin_dt
WHEN (per_level_name = 'CALENDAR MTH')
THEN cal_mnth_begin_dt
WHEN (per_level_name = 'ADVERTISING YR')
THEN cal_yr_begin_dt
END AS begin_date,
CASE
WHEN (per_level_name = 'ADVERTISING WK'
)
THEN ad_wk_end_dt
WHEN (per_level_name = 'SCANNING WK')
THEN scan_wk_end_dt
WHEN (per_level_name = 'PROMO PLAN PERIOD')
THEN promo_per_end_dt
WHEN (per_level_name = 'CALENDAR MTH')
THEN cal_mnth_end_dt
WHEN (per_level_name = 'ADVERTISING YR')
THEN cal_yr_end_dt
END AS end_date
FROM admet_period) metricsper1_
WHERE metricsent0_.per_id = metricsper1_.per_id
AND metricsper1_.per_level_name = ?
AND (metricsper1_.begin_date BETWEEN ? AND ?)
AND (metricsper1_.end_date BETWEEN ? AND ?)
AND (metricsent0_.loc_id IS NULL))
WHERE ROWNUM <= ?