facebook

How to query a composite key class

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #233430 Reply

    dika151
    Member

    I have a table named Tapplicationproject in my database.

    When I generated the hibernate mapping using myeclipse, The following files were created:

    – AbstractTapplicationproject.java
    properties that I need (all are accessible from Tapplicationproject.java):
    – description
    – endDate
    – id
    – location
    – role
    – startDate
    – tools

    – Tapplicationproject.java
    properties that I need: (NONE) but I’m using this class to access all fields

    – TapplicationprojectKey.java
    properties that I DESPERATELY need:
    – applicationId
    – projectName

    – Tapplicationproject.hbm.xml

    Now, I need to get ALL fields from Tapplicationproject table.

    The problem is, the composite primary keys (‘applicationId’ & ‘projectName’ properties) are stored ONLY in the TapplicationprojectKey.java and I cannot query this class.

    When I tried to query TapplicationprojectKey.java, the compiler said that TapplicationprojectKey is not a persistent class. So I have no idea how to query the ‘applicationId’ & ‘projectName’ from the TapplicationprojectKey using the HQL query.

    Anyone know the way to work around this?

    #233455 Reply

    Riyad Kalla
    Member

    I will ask our Hibernate developer if he has any suggestions for you..

    #233484 Reply

    dika151
    Member

    Thank you.. I appreciate that a lot.. coz I really need this to work for my first project on my first job

    #233548 Reply

    dika151
    Member

    Sorry Mr. Moderator,

    I don’t mean to rush you, but I really need some suggestion as soon as possible.. Because this is really important to me.

    Thank you

    #233549 Reply

    Riyad Kalla
    Member

    dika,
    I’m sorry I asked the developers that had worked on the Hibernate modules and none of them had any suggestions for you. Have you tried asking your question on the Hibernate forums here: http://forums.hibernate.org/

    I realize this maybe be a primarily MyEclipse issue since our tool generated the code, but the Hibernate forums can be helpful for folks that are in similar situations as our users sometimes.

    #233550 Reply

    dika151
    Member

    OK,

    I appreciate your quick response and that you’ve asked the hibernate developers.. So thank you once again.. I’ll try to find some answers from the hibernate forums.

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: How to query a composite key class

You must be logged in to post in the forum log in