-->
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.  [ 5 posts ] 
Author Message
 Post subject: retrieving abstract class
PostPosted: Tue May 24, 2005 6:25 pm 
Newbie

Joined: Wed Mar 30, 2005 12:09 pm
Posts: 10
Hi guys!
I have copied an example from http://www-128.ibm.com/developerworks/j ... /#download and tried going the same way for my abstract class BaseTransaction (BaseClaimStatus inherits from BaseTransaction) but I am not sure what more to do to not get that abstract class initiation exception. I am building the query in the following way:

String qryStr = "select ct from " + BaseTransaction.class.getName() + " as ct where ct.processingId = '" + processingId + "'" +
" and ct.transactionId = '" + transactionId + "'";

I am stuck here...
Hibernate version: version 3.0 downloaded somewhere in last week of april

Mapping documents:
<hibernate-mapping>

<class name="com.webmd.bna.edi.base.BaseTransaction" table="AC_CS_TRANSACTION" polymorphism="implicit" abstract="true">
<composite-id>
<key-property name="transactionId" column="Transaction_ID" type="string" length="255" access="field"/>
<key-property name="processingId" column="Processing_ID" type="string" length="255" access="field"/>
</composite-id>

<property name="preBatchPath" column="PreBatch_Path" type="string" length="255" access="field"/>

<many-to-one name="interchangeSenderId" class="com.webmd.bna.edi.Id" column="Int_Sender_ID" cascade="all" unique="true"/>
<many-to-one name="interchangeReceiverId" class="com.webmd.bna.edi.Id" column="Int_Receiver_ID" cascade="all" unique="true"/>
<many-to-one name="applicationReceiverId" class="com.webmd.bna.edi.Id" column="App_Receiver_ID" cascade="all" unique="true"/>
<many-to-one name="applicationSenderId" class="com.webmd.bna.edi.Id" column="App_Sender_ID" cascade="all" unique="true"/>


<property name="interchangeControlNo" column="Interchg_Control_No" type="string" length="255" access="field"/>
<property name="usageIndicator" column="Usage_Ind" type="string" length="255" access="field"/>
<property name="segmentSeparator" column="Segment_Sep" type="string" length="255" access="field"/>
<property name="elementSeparator" column="Element_Sep" type="string" length="255" access="field"/>
<property name="subElementSeparator" column="Sub_Element_Sep" type="string" length="255" access="field"/>
<property name="rebatchPath" column="Rebatch_Path" type="string" length="255" access="field"/>
<property name="submitterBatchId" column="Submitter_Batch_ID" type="string" length="255" access="field"/>
<property name="clearinghouseFileId" column="Clrng_Hs_File_ID" type="string" length="255" access="field"/>
<property name="interchangeCreateDate" column="Intchg_Create_Date" type="string" length="255" access="field"/>
<property name="groupControlNo" column="Grp_Control_No" type="string" length="255" access="field"/>
<property name="transactionSetControlNo" column="Trx_Set_Cntrl_No" type="string" length="255" access="field"/>
<property name="hlId" column="Hl_Id" type="string" length="255" access="field"/>
<property name="hierarchicalTransactionId" column="Hierarchical_Trx_ID" type="string" length="255" access="field"/>
<property name="outboundFileId" column="Outbound_File_ID" type="string" length="255" access="field"/>
<property name="outboundFileSequence" column="OutBnd_File_Seq" type="integer" access="field"/>

<property name="transactionSetCreateTime" column="Trx_Set_Create_Time" type="string" length="255" access="field"/>
<property name="transactionSetCreateDate" column="Trx_Set_Create_Date" type="string" length="255" access="field"/>
<property name="applicationControlNo" column="App_Control_No" type="string" length="255" access="field"/>
<property name="targetFormat" column="Target_Format" type="integer" access="field"/>
<property name="inboundFormat" column="Inbound_Format" type="integer" access="field"/>
<property name="transactionLevel" column="Transaction_Level" type="integer" access="field"/>
<property name="transactionSubType" column="Trx_Sub_Type" type="integer" access="field"/>
<property name="transactionType" column="Transaction_Type" type="integer" access="field"/>
<property name="status" column="Status" type="integer" access="field"/>
<property name="statusReasonCode" column="StatusReasonCode" type="integer" access="field"/>
<property name="isRoot" column="Is_Root" type="boolean" access="field"/>
<property name="split" column="Split" type="boolean" access="field"/>


<joined-subclass name="com.webmd.bna.edi.base.status.BaseClaimStatus" table="AC_CS_CLAIM_STATUS">
<key>
<column name="Transaction_ID"/>
<column name="Processing_ID"/>
</key>

<many-to-one name="provider" class="com.webmd.bna.edi.base.BaseProvider" column="Provider_ID" cascade="all" unique="true"/>
<many-to-one name="payer" class="com.webmd.bna.edi.base.BasePayer" column="Payer_ID" cascade="all" unique="true"/>
<many-to-one name="subscriber" class="com.webmd.bna.edi.base.BaseInsured" column="Subscriber_ID" cascade="all" unique="true"/>
<many-to-one name="patient" class="com.webmd.bna.edi.base.BasePatient" column="Patient_ID" cascade="all" unique="true"/>
<many-to-one name="infoReceiver" class="com.webmd.bna.edi.base.BaseOrganization" column="Info_Receiver_ID" cascade="all" unique="true"/>


<list name="serviceLineStatusItems" inverse="true" lazy="true" cascade="all" access="field">
<key>
<column name="Transaction_ID"/>
<column name="Processing_ID"/>
</key>
<list-index column="Service_Line_Seq_No"/>
<one-to-many class="com.webmd.bna.edi.base.status.BaseServiceLineStatus"/>
</list>

<list name="statusElements" inverse="true" lazy="true" cascade="all" access="field">
<key>
<column name="Transaction_ID" not-null="true"/>
<column name="Processing_ID" not-null="true"/>
</key>
<list-index column="Status_Elem_Seq_No"/>
<one-to-many class="com.webmd.bna.edi.base.status.BaseClaimStatusElement"/>
</list>

<property name="clearinghouseTraceNo" column="Clearinghouse_Trace_No" type="string" length="255" access="field"/>
<property name="billType" column="Bill_Type" type="string" length="100" access="field"/>
<property name="statementFromDate" column="Statement_From_Date" type="string" length="11" access="field"/>
<property name="statementToDate" column="Statement_To_Date" type="string" length="11" access="field"/>
<property name="medicalRecordId" column="Medical_Record_ID" type="string" length="255" access="field"/>
<property name="actionCode" column="Action_Code" type="string" length="100" access="field"/>
<property name="totalCharges" column="Total_Charges" type="string" length="9" access="field"/>
<property name="paymentAmount" column="Payment_Amount" type="string" length="9" access="field"/>
<property name="paymentMethod" column="Payment_Method" type="string" length="255" access="field"/>
<property name="paymentDate" column="Payment_Date" type="string" length="11" access="field"/>
<property name="checkDate" column="Check_Date" type="string" length="11" access="field"/>
<property name="checkNo" column="Check_No" type="string" length="22" access="field"/>
<property name="payerStatusDate" column="Payer_Status_Date" type="string" length="11" access="field"/>
<property name="payerClaimNo" column="Payer_Claim_No" type="string" length="255" access="field"/>
<property name="payerTransactionTraceNo" column="Payer_Trx_Trace_No" type="string" length="255" access="field"/>
<property name="infoSourceReceiptDate" column="Info_Source_Rcpt_Date" type="string" length="11" access="field"/>
<property name="infoSourceProcessDate" column="Info_Source_Proc_Date" type="string" length="11" access="field"/>
<property name="statusMessage" column="Status_Message" type="string" length="255" access="field"/>
<property name="statusData" column="Status_Data" type="string" length="255" access="field"/>
</joined-subclass>


</class>

<class name="com.webmd.bna.edi.base.BasePayer" table="AC_CS_PAYER">
<id name="genPyrId" column="Gen_Pyr_ID" access="field">
<generator class="native"/>
</id>

<one-to-one name="patient" class="com.webmd.bna.edi.base.BasePatient"/>

<one-to-one name="referringProvider" class="com.webmd.bna.edi.base.BaseProvider"/>
<one-to-one name="primaryCareProvider" class="com.webmd.bna.edi.base.BaseProvider"/>
<one-to-one name="renderingProvider" class="com.webmd.bna.edi.base.BaseProvider"/>
<one-to-one name="purchasedServiceProvider" class="com.webmd.bna.edi.base.BaseProvider"/>
<one-to-one name="serviceFacility" class="com.webmd.bna.edi.base.BaseProvider"/>
<one-to-one name="supervisingProvider" class="com.webmd.bna.edi.base.BaseProvider"/>



<property name="groupName" column="Group_Name" type="string" length="255" access="field"/>
<property name="groupNo" column="Group_No" type="string" length="255" access="field"/>
<property name="ppoHmoIndicator" column="Ppo_Hmo_Indicator" type="string" length="255" access="field"/>
<property name="ppoHmoId" column="Ppo_Hmo_Id" type="string" length="255" access="field"/>
<property name="claimFilingIndicator" column="Claim_Filing_Indicator" type="string" length="255" access="field"/>
<property name="ClaimControlNo" column="Claim_Control_No" type="string" length="255" access="field"/>
<property name="providerNo" column="Provider_No" type="string" length="255" access="field"/>
<property name="insuranceTypeCode" column="Insurance_Type_Code" type="string" length="255" access="field"/>
<property name="paymentRequestFlag" column="Payment_Request_Flag" type="string" length="255" access="field"/>
<property name="claimAdjudicationDate" column="Claim_Adjudication_Date" type="string" length="255" access="field"/>
<property name="cobAmountPaid" column="Cob_Amount_Paid" type="string" length="255" access="field"/>
<property name="cobApprovedAmount" column="Cob_Approved_Amount" type="string" length="255" access="field"/>
<property name="cobAllowedAmount" column="Cob_Allowed_Amount" type="string" length="255" access="field"/>
<property name="cobCoveredAmount" column="Cob_Covered_Amount" type="string" length="255" access="field"/>
<property name="cobDiscountAmount" column="Cob_Discount_Amount" type="string" length="255" access="field"/>
<property name="cobPerDayLimitAmount" column="Cob_Per_Day_Lim_Amt" type="string" length="255" access="field"/>
<property name="cobPatientAmountPaid" column="Cob_Pat_Amt_Paid" type="string" length="255" access="field"/>
<property name="cobTaxAmount" column="Cob_Tax_Amount" type="string" length="255" access="field"/>
<property name="cobTotalClaimBeforeTaxesAmount" column="Cob_Tot_Clm_Bef_Tax_Amt" type="string" length="255" access="field"/>
<property name="cobPatientResponsibility" column="Cob_Pat_Resp" type="string" length="255" access="field"/>
<property name="division" column="Division" type="string" length="255" access="field"/>


<many-to-one name="insured" class="com.webmd.bna.edi.base.BaseInsured" access="field">
<column name="Gen_Ins_ID"/>
</many-to-one>
<one-to-one name="claimStatus" class="com.webmd.bna.edi.base.status.BaseClaimStatus" property-ref="payer"/>

</class>


<class name="com.webmd.bna.edi.base.BaseProvider" table="AC_CS_PROVIDER">

<id name="genProvId" column="Gen_Prov_ID" access="field">
<generator class="native"/>
</id>

<property name="specialtyType" column="Specialty_Type" type="string" length="255" access="field"/>
<property name="specialty" column="Specialty" type="string" length="255" access="field"/>
<property name="siteId" column="Site_Id" type="string" length="255" access="field"/>
<property name="phone" column="Phone" type="string" length="255" access="field"/>
<property name="type" column="Type" type="string" length="255" access="field"/>
<property name="charge" column="Charge" type="string" length="255" access="field"/>
<property name="practiceType" column="Practice_Type" type="string" length="255" access="field"/>

<one-to-one name="claimStatus" class="com.webmd.bna.edi.base.status.BaseClaimStatus" property-ref="provider" access="field"/>


<many-to-one name="payer" class="com.webmd.bna.edi.base.BasePayer" access="field">
<column name="Gen_Pyr_ID"/>
</many-to-one>

<many-to-one name="insured" class="com.webmd.bna.edi.base.BaseInsured" access="field">
<column name="Gen_Ins_ID"/>
</many-to-one>
</class>

....
....
....
</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():
List results = null;
try {
Session session = HibernateSession.currentSession();
Transaction tx = session.beginTransaction();
Query query = session.createQuery(qry);
System.err.println("Creating current session4");
System.err.println("query is: " + query);

if(query == null) {
System.err.println("Query is null: " + query);
}

results = query.list();
System.err.println("query . list");

tx.commit();
System.err.println("tx is committed");
}
catch(HibernateException he) {
he.printStackTrace();
throw new DAOException(he);
}
finally {
closeSession();
}

return results;

}

Full stack trace of any exception that occurs:
Creating current session4
query is: QueryImpl(select ct from com.webmd.bna.edi.base.BaseTransaction as ct where ct.processingId = 'BNAWLACHANDRA.f5b2e4.10410c2141c.68726' and ct.transactionId = 'BNAWLACHANDRA.5878d2.104103ab81a.614164.0.0')
org.hibernate.InstantiationException: Cannot instantiate abstract class or interface: com.webmd.bna.edi.base.BaseTransaction
at org.hibernate.tuple.PojoInstantiator.instantiate(PojoInstantiator.java:56)
at org.hibernate.tuple.AbstractComponentTuplizer.instantiate(AbstractComponentTuplizer.java:89)
at org.hibernate.type.ComponentType.instantiate(ComponentType.java:344)
at org.hibernate.type.ComponentType.instantiate(ComponentType.java:350)
at org.hibernate.type.EmbeddedComponentType.instantiate(EmbeddedComponentType.java:52)
at org.hibernate.type.ComponentType.resolve(ComponentType.java:440)
at org.hibernate.type.ComponentType.nullSafeGet(ComponentType.java:182)
at org.hibernate.loader.Loader.getKeyFromResultSet(Loader.java:691)
at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:280)
at org.hibernate.loader.Loader.doQuery(Loader.java:387)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:206)
at org.hibernate.loader.Loader.doList(Loader.java:1515)
at org.hibernate.loader.Loader.list(Loader.java:1498)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:369)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:266)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:788)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at com.webmd.bna.database.hibernate.HibernateBaseDAO.retrieveObjs(HibernateBaseDAO.java:156)
at com.webmd.bna.database.hibernate.ClaimStatusDAO.getClaimStatus(ClaimStatusDAO.java:43)
at com.webmd.bna.support.application.SupportDAO.getClaimStatus(SupportDAO.java:793)
at com.webmd.bna.support.application.SupportDAO.getTransactionHistory(SupportDAO.java:1006)
at com.webmd.bna.support.application.SupportDAO.getTransactions(SupportDAO.java:874)
at com.webmd.bna.support.application.SupportDAO.getTransactions(SupportDAO.java:905)
at com.webmd.bna.support.application.SupportFrame.displayAllButton_actionPerformed(SupportFrame.java:299)
at com.webmd.bna.support.application.SupportFrame$7.actionPerformed(SupportFrame.java:135)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1786)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(AbstractButton.java:1839)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:245)
at java.awt.Component.processMouseEvent(Component.java:5100)
at java.awt.Component.processEvent(Component.java:4897)
at java.awt.Container.processEvent(Container.java:1569)
at java.awt.Component.dispatchEventImpl(Component.java:3615)
at java.awt.Container.dispatchEventImpl(Container.java:1627)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3198)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
at java.awt.Container.dispatchEventImpl(Container.java:1613)
at java.awt.Window.dispatchEventImpl(Window.java:1606)
at java.awt.Component.dispatchEvent(Component.java:3477)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Top
 Profile  
 
 Post subject: Would somebody mind helping me on this?
PostPosted: Wed May 25, 2005 11:40 am 
Newbie

Joined: Wed Mar 30, 2005 12:09 pm
Posts: 10
I am not able to proceed any further. I have tried lot of things including download hibernate 3 version again today, but I am still getting the same error. I do need help in this to proceed further..
Thanx


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 11:50 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Classes with embedded composite ids cannot be abstract. Make the class non-abstract, or use the recommended approach to handling composite keys (a composite-key class).

(I am inclined to remove this limitation, if possible.)


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 25, 2005 11:51 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Probably not possible, however....


Top
 Profile  
 
 Post subject: Thank You very much Gavin
PostPosted: Wed May 25, 2005 2:55 pm 
Newbie

Joined: Wed Mar 30, 2005 12:09 pm
Posts: 10
Your reply did really help me. I have already read the document but do you have any example which you can point me to for writing composite-id class?? I know how to use it but I haven't seen any example of that anywhere. I know it is supposed to implement Serializable and also suppose to overwrite equal and hashcode methods...
Thanx a lot


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

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.