Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6755377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:23:32+00:00 2026-05-26T13:23:32+00:00

When I execute my program without implementing hashcode() and toString() then it works fine.

  • 0

When I execute my program without implementing hashcode() and toString() then it works fine. But as soon as I include hashcode() and toString() then I get this “illegal access to loading collection” error.

My hbm files are

1) booking.hbm.xml

<many-to-one name="userId" class="User" column="user_id"
        insert="true" update="true" cascade="save-update" >
    </many-to-one>
    <many-to-one name="flightId" class="FlightSchedule"
        column="flight_id" cascade="all" not-null="true">
    </many-to-one>

    <set name="passenger" table="passenger79215" lazy="false"
        inverse="true" cascade="save-update">
        <key column="reference_id" />
        <one-to-many class="Passenger" />
    </set>

2) Passenger.hbm.xml

<many-to-one name="referenceid" class="Booking" lazy="false"
        insert="true" update="true" column="reference_id "
        cascade="save-update">
    </many-to-one>

3) User.hbm.xml

<set name="booking" table="bookings79215" lazy="true"
        inverse="false" cascade="save-update">
        <key column="user_id" />
        <one-to-many class="Booking" />
    </set>

Can anyone explain the error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:23:33+00:00Added an answer on May 26, 2026 at 1:23 pm

    Your hashcode and equals methods are not working properly. Make sure that they are correct. toString() has nothing to do with collection classes but hashcode and equals does.

    I assume that you have overridden both hashcode and equals and not only hashcode.

    Object#hashCode() (Java Platform SE 7 )

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is with reference to the below question: Execute program from within a C
I have a Python script that needs to execute an external program, but for
How do I execute a command-line program from C# and get back the STD
I have this program that should execute a piece of code base on the
I wrote this C program for Win32/c compiler but while i'm trying run this
When I execute the following java program, sometimes I get an empty response ,
For some reason, when I execute this program with the following expression 12 12
How do I execute a program from within my program without blocking until the
I just wonder, can we execute a program on a machine without an operating
I'm wanting to execute a program and as it runs read in it's output

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.