0 Replies Latest reply on Jul 19, 2005 8:08 AM by Colin Goudie

    Object reference in Primary Key Class

    Colin Goudie Newbie

      Ok, I'm finally getting some of my old 2.1 beans deployed now by commenting out large pieces that are throwing exceptions.

      I'm using JBoss 4.0.3RC1

      One of the issues I'm currently having is to do with a composite key class in my PaymentBean.

      I have an InvoiceBean (PK is invoiceId column=invoice_id)

      I then have a PaymentBean (PK is PaymentPK composite key class with two members invoiceId and paymentId Columns are invoice_id,payment_id respectivley)

      Now I have constructed the composite bean as above as it was the only way I could get it to deploy. What I would rather have is instead of the invoiceId (which is a long) in my PK class I would like the actual reference to an InvoiceBean. This way in my PaymentBean class I can have a method like

      public InvoiceBean getInvoice() {
      return pk.getInvoice();
      }

      When I attempt to use an InvoiceBean as the type in my PaymentPK class I end up with an error that says
      Could not determine type for: com.positive.beans.entity.InvoiceBean, for columns: [org.hibernate.mapping.Column(invoice_id)]

      Any suggestions? Thanks