All,
I am pretty much new to Hibernate but have a project to do so hope will get some help from here.
I have a SQL query like
SELECT FIELD_KEY,FIELD_VALUE FROM TBL_FIELD_DATA, TBL_FEATURE_MASTER WHERE TBL_FEATURE_MASTER.FEATURE_ID = @FEATURE_ID AND TBL_FEATURE_MASTER.FIELD_ID = TBL_FIELD_DATA.FIELD_ID AND TBL_FEATURE_MASTER.FLOW_CODE = @FLOW_CODE;
And I have written the relevant HQL as
select FD.fieldDataCompoundkey.Field_key, FD.Field_Value from FieldData FD,FeatureMaster FM where " +"FM.featureId =? and FM.fieldId=FD.fieldDataCompoundkey.Field_ID and FM.flowCode =?
But i am getting an exception like Exception : java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to com.hibernate.db.tables.FieldData java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to com.hibernate.db.tables.FieldData at com.hibernate.test.Test.main(Test.java:139)
I know that the query is returning me objects of different class [See below from Log] how do i resolve this.
com.hibernate.db.tables.FieldData{Field_Value=EmergencyFlow_1.wav, fieldDataCompoundkey=component[Field_ID,Field_key]{Field_ID=IND_TAM_GEN_EmergencyFlow, Field_key=Emergency_Prompt}, Field_Description=Configure Emergency Prompt if Enabled} 16:47:09,962 DEBUG Printer:90 - com.hibernate.db.tables.FieldData{Field_Value=True, fieldDataCompoundkey=component[Field_ID,Field_key]{Field_ID=IND_TAM_GEN_EmergencyFlow, Field_key=Emergency_Flag}, Field_Description=Configure Emergency Prompt if Enabled
Any help is much appreciated.
Rgds/binny
|