I have done a lot of looking (FAQs, forums, Google) and I've not seen anything remotely like this. Anyone experience anything similar?
Symptoms:
(1) The generated query is correct
(2) The number of rows returned is correct
(3) I looked at all of the columns and tables in the query and they are correct
(4) I ran the query in SQLPlus and it is returning the correct values
(5) One of the properties of CaseAction (description) is set to NULL despite having values in both rows
(6) I looked at the debug log and Hibernate is only binding 19 of the several dozen columns returned.
My question is this: is (6) normal? Is there a setting that limits the number of columns bound in any given result set? Based on what I see, there doesn't seem to be a limitation in Oracle...am I wrong? Can I make the many-to-one associations load lazily so that fewer columns/tables are loaded?
Hibernate version:
2.1.7 (I think)
Mapping documents:
(Too many to list...not a mapping problem)
Code between sessionFactory.openSession() and session.close():
(Code executes correctly)
Full stack trace of any exception that occurs:
(No exception)
Name and version of the database you are using:
Oracle 9i 9.2.0.1.0
The generated SQL (show_sql=true):
Okay, you asked for it :)
Code:
select this.CASE_ACTION_ID as CASE_ACT1_18_, this.CASE_HIST_ID as CASE_HIS2_18_, this.CASE_ACTION_TYPE_ID as CASE_ACT3_18_, this.PERFORMED as PERFORMED18_, this.PERFORMED_BY_USER_ID as PERFORME5_18_, this.FROM_ORG_ID as FROM_ORG6_18_, this.TO_ORG_ID as TO_ORG_ID18_, this.DESCRIPTION as DESCRIPT8_18_, ch.CASE_HIST_ID as CASE_HIS1_0_, ch.CASE_ID as CASE_ID0_, ch.REVISION as REVISION0_, ch.MEMBER_LAST_NAME as MEMBER_L4_0_, ch.MEMBER_FIRST_NAME as MEMBER_F5_0_, ch.MEMBER_MIDDLE as MEMBER_M6_0_, ch.TITLE as TITLE0_, ch.DESCRIPTION as DESCRIPT8_0_, ch.ADSN as ADSN0_, ch.FID as FID0_, ch.ACT_IND as ACT_IND0_, ch.ERR_CD as ERR_CD0_, ch.CATG as CATG0_, ch.SVC_ADSN as SVC_ADSN0_, ch.CASE_CATEGORY_ID as CASE_CA15_0_, ch.GRADE_ID as GRADE_ID0_, ch.SERVICING_ORG_ID as SERVICI17_0_, case2_.CASE_ID as CASE_ID1_, case2_.SSN as SSN1_, case2_.CASE_TYPE_ID as CASE_TYP3_1_, case2_.CASE_STATUS_ID as CASE_STA4_1_, case2_.OPENED as OPENED1_, case2_.CLOSED as CLOSED1_, case2_.FOLLOWUP as FOLLOWUP1_, case2_.DELETED as DELETED1_, case2_.READ as READ1_, case2_.OPENED_BY_USER_ID as OPENED_10_1_, case2_.CLOSED_BY_USER_ID as CLOSED_11_1_, case2_.DELETED_BY_USER_ID as DELETED12_1_, case2_.OPENED_IN_ORG_ID as OPENED_13_1_, case2_.ASSIGNED_TO_ORG_ID as ASSIGNE14_1_, case2_.CLOSED_IN_ORG_ID as CLOSED_15_1_, case2_.DELETED_IN_ORG_ID as DELETED16_1_, case2_.UNREAD as UNREAD1_, case2_.SOURCE_ID as SOURCE_ID1_, casetype3_.CASE_TYPE_ID as CASE_TYP1_2_, casetype3_.ORG_ID as ORG_ID2_, casetype3_.NAME as NAME2_, casetype3_.DESCRIPTION as DESCRIPT4_2_, casestatus4_.CASE_STATUS_ID as CASE_STA1_3_, casestatus4_.NAME as NAME3_, casestatus4_.DESCRIPTION as DESCRIPT3_3_, user5_.USER_ID as USER_ID4_, user5_.ORG_ID as ORG_ID4_, user5_.NAME as NAME4_, user5_.SSN as SSN4_, user5_.LAST_NAME as LAST_NAME4_, user5_.FIRST_NAME as FIRST_NAME4_, user5_.MIDDLE as MIDDLE4_, user5_.GRADE_ID as GRADE_ID4_, user5_.PHONE as PHONE4_, user5_.EMAIL as EMAIL4_, user5_.ACTIVE as ACTIVE4_, user5_.PERMANENT as PERMANENT4_, organizati6_.ORG_ID as ORG_ID5_, organizati6_.ORG_TYPE_ID as ORG_TYPE2_5_, organizati6_.PARENT_ORG_ID as PARENT_O3_5_, organizati6_.NAME as NAME5_, organizati6_.ACTIVE as ACTIVE5_, organizati6_.PERMANENT as PERMANENT5_, organizati6_.THEME as THEME5_, GET_ORG_HEIGHT( organizati6_.ORG_ID ) as f0_5_, organizati7_.ORG_TYPE_ID as ORG_TYPE1_6_, organizati7_.NAME as NAME6_, organizati7_.DESCRIPTION as DESCRIPT3_6_, benchmark8_.ORG_ID as ORG_ID7_, benchmark8_.DAYS_OPEN as DAYS_OPEN7_, benchmark8_.DAYS_IN_ORG as DAYS_IN_3_7_, grade9_.GRADE_ID as GRADE_ID8_, grade9_.ORG_ID as ORG_ID8_, grade9_.SEQUENCE as SEQUENCE8_, grade9_.CODE as CODE8_, grade9_.NAME as NAME8_, grade9_.DESCRIPTION as DESCRIPT6_8_, grade9_.TITLE as TITLE8_, grade9_.MILITARY as MILITARY8_, grade9_.CIVILIAN as CIVILIAN8_, source10_.SOURCE_ID as SOURCE_ID9_, source10_.NAME as NAME9_, source10_.DESCRIPTION as DESCRIPT3_9_, casecatego11_.CASE_CATEGORY_ID as CASE_CAT1_10_, casecatego11_.NAME as NAME10_, casecatego11_.DESCRIPTION as DESCRIPT3_10_, grade12_.GRADE_ID as GRADE_ID11_, grade12_.ORG_ID as ORG_ID11_, grade12_.SEQUENCE as SEQUENCE11_, grade12_.CODE as CODE11_, grade12_.NAME as NAME11_, grade12_.DESCRIPTION as DESCRIPT6_11_, grade12_.TITLE as TITLE11_, grade12_.MILITARY as MILITARY11_, grade12_.CIVILIAN as CIVILIAN11_, caseaction13_.CASE_ACTION_TYPE_ID as CASE_ACT1_12_, caseaction13_.SEC_PERM_ID as SEC_PERM2_12_, caseaction13_.NAME as NAME12_, caseaction13_.DESCRIPTION as DESCRIPT4_12_, caseaction13_.TO_CASE_STATUS_ID as TO_CASE_5_12_, securitype14_.SEC_PERM_ID as SEC_PERM1_13_, securitype14_.SEC_ACT_ID as SEC_ACT_ID13_, securitype14_.SEC_OBJ_ID as SEC_OBJ_ID13_, securitype14_.TO_SEC_OBJ_ID as TO_SEC_O4_13_, securitype14_.DESCRIPTION as DESCRIPT5_13_, securityac15_.SEC_ACT_ID as SEC_ACT_ID14_, securityac15_.NAME as NAME14_, securityob16_.SEC_OBJ_ID as SEC_OBJ_ID15_, securityob16_.NAME as NAME15_, securityob16_.CLASS_NAME as CLASS_NAME15_, securityob17_.SEC_OBJ_ID as SEC_OBJ_ID16_, securityob17_.NAME as NAME16_, securityob17_.CLASS_NAME as CLASS_NAME16_, casestatus18_.CASE_STATUS_ID as CASE_STA1_17_, casestatus18_.NAME as NAME17_, casestatus18_.DESCRIPTION as DESCRIPT3_17_ from CASE_ACTION this, CASE_HIST ch, CASE case2_, CASE_TYPE casetype3_, CASE_STATUS casestatus4_, "USER" user5_, ORG organizati6_, ORG_TYPE organizati7_, BENCHMARK benchmark8_, GRADE grade9_, SOURCE source10_, CASE_CATEGORY casecatego11_, GRADE grade12_, CASE_ACTION_TYPE caseaction13_, SEC_PERM securitype14_, SEC_ACT securityac15_, SEC_OBJ securityob16_, SEC_OBJ securityob17_, CASE_STATUS casestatus18_ where ch.CASE_ID=? and this.CASE_HIST_ID=ch.CASE_HIST_ID and ch.CASE_ID=case2_.CASE_ID(+) and case2_.CASE_TYPE_ID=casetype3_.CASE_TYPE_ID(+) and case2_.CASE_STATUS_ID=casestatus4_.CASE_STATUS_ID(+) and case2_.OPENED_BY_USER_ID=user5_.USER_ID(+) and user5_.ORG_ID=organizati6_.ORG_ID(+) and organizati6_.ORG_TYPE_ID=organizati7_.ORG_TYPE_ID(+) and organizati6_.ORG_ID=benchmark8_.ORG_ID(+) and user5_.GRADE_ID=grade9_.GRADE_ID(+) and case2_.SOURCE_ID=source10_.SOURCE_ID(+) and ch.CASE_CATEGORY_ID=casecatego11_.CASE_CATEGORY_ID(+) and ch.GRADE_ID=grade12_.GRADE_ID(+) and this.CASE_ACTION_TYPE_ID=caseaction13_.CASE_ACTION_TYPE_ID(+) and caseaction13_.SEC_PERM_ID=securitype14_.SEC_PERM_ID(+) and securitype14_.SEC_ACT_ID=securityac15_.SEC_ACT_ID(+) and securitype14_.SEC_OBJ_ID=securityob16_.SEC_OBJ_ID(+) and securitype14_.TO_SEC_OBJ_ID=securityob17_.SEC_OBJ_ID(+) and caseaction13_.TO_CASE_STATUS_ID=casestatus18_.CASE_STATUS_ID(+) order by this.PERFORMED asc
Debug level Hibernate log excerpt:Code:
net.sf.hibernate.impl.BatcherImpl [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] preparing statement
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] binding '7' to parameter: 1
net.sf.hibernate.loader.Loader [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] processing result set
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '7' as column: CASE_HIS1_0_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '7' as column: CASE_ID1_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '10' as column: CASE_TYP1_2_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '3' as column: CASE_STA1_3_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '100' as column: USER_ID4_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '101' as column: ORG_ID5_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '101' as column: ORG_TYPE1_6_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning null as column: ORG_ID7_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning null as column: GRADE_ID8_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '3' as column: SOURCE_ID9_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '1' as column: CASE_CAT1_10_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '7' as column: GRADE_ID11_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '2' as column: CASE_ACT1_12_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '21' as column: SEC_PERM1_13_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '7' as column: SEC_ACT_ID14_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '5' as column: SEC_OBJ_ID15_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning null as column: SEC_OBJ_ID16_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '3' as column: CASE_STA1_17_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '15' as column: CASE_ACT1_18_
net.sf.hibernate.loader.Loader [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] result row: 7, 7, 10, 3, 100, 101, 101, null, null, 3, 1, 7, 2, 21, 7, 5, null, 3, 15
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '7' as column: CASE_HIS1_0_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '7' as column: CASE_ID1_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '10' as column: CASE_TYP1_2_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '3' as column: CASE_STA1_3_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '100' as column: USER_ID4_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '101' as column: ORG_ID5_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '101' as column: ORG_TYPE1_6_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning null as column: ORG_ID7_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning null as column: GRADE_ID8_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '3' as column: SOURCE_ID9_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '1' as column: CASE_CAT1_10_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '7' as column: GRADE_ID11_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '2' as column: CASE_ACT1_12_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '21' as column: SEC_PERM1_13_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '7' as column: SEC_ACT_ID14_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '5' as column: SEC_OBJ_ID15_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning null as column: SEC_OBJ_ID16_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '3' as column: CASE_STA1_17_
net.sf.hibernate.type.LongType [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] returning '16' as column: CASE_ACT1_18_
net.sf.hibernate.loader.Loader [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] result row: 7, 7, 10, 3, 100, 101, 101, null, null, 3, 1, 7, 2, 21, 7, 5, null, 3, 16
net.sf.hibernate.loader.Loader [DEBUG] 02/03/05 16:05:39 [http8084-Processor24] done processing result set (2 rows)
[/code]