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 8172013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T21:38:46+00:00 2026-06-06T21:38:46+00:00

I have problem with lazy loading in many-to-many. There is no exception and there

  • 0

I have problem with lazy loading in many-to-many. There is no exception and there are rows in database but lazy loading returns 0 rows. Do you know why?

MAPPING:

 <class name="Riesitel" table="riesitel" lazy="true" >
    <composite-id>
      <key-many-to-one lazy="false" name="os_udaje">
        <column name="os_cislo" sql-type="integer" not-null="true" />
      </key-many-to-one>

      <key-many-to-one lazy="false" name="projekt_etapa">
        <column name="rok" not-null="true" />
        <column name="id_projektu" not-null="true" />
        <column name="id_fakulty" not-null="true" />
      </key-many-to-one>
    </composite-id>

    <bag name="riesitel_rolas" inverse="true" cascade="none" table="riesitel_rola">
         <key>
           <column name="os_cislo"/>
           <column name="rok"/>
           <column name="id_projektu"/>
           <column name="id_fakulty"/>
         <!--   <column name="id_rola" sql-type="Char"/> -->
        </key>
      <many-to-many class="Rola_v_projekte">
        <column name="id_rola"/>
      </many-to-many>
    </bag>


  <class name="Rola_v_projekte" table="rola_v_projekte" lazy="true" >

    <id name="id_rola">
      <column name="id_rola" sql-type="integer" not-null="true" />
      <generator class="sequence">
        <param name="sequence">id_rola_seq</param>
      </generator>
    </id>

    <bag name="riesitel_rolas" inverse="true" cascade="none" table="riesitel_rola">
      <key>
        <column name="id_rola" />
      </key>
      <many-to-many class="Riesitel">
        <column name="os_cislo"/>
        <column name="rok"/>
        <column name="id_projektu"/>
        <column name="id_fakulty"/>
      </many-to-many>
    </bag>

DB model:
enter image description here

  • 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-06-06T21:38:48+00:00Added an answer on June 6, 2026 at 9:38 pm

    I do not kwnow exactly why.. but: i think it is bug in NHibernate.. When i change my databese to non-composite id and change mapping all start working regurely:

    enter image description here

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

Sidebar

Related Questions

I've reviewed some posts about lazy loading but I believe my problem is a
I have a problem with lazy loading in hibernate when dealing with inheritance. I
I have implemented lazy loading in my program. it's done through a proxy class
I have problem while loading data into html select when users press or click
I have problem SIMILAR to preventing form data reposting, but not quite the same
I'm using NHibernate to administer my entities, and to have lazy loading enabled I
Given the following mapping <class name=com.domain.Season table=cm.pub.jsn_mstr> <id name=seasonCode column=season_code length=1/> <property name=name type=string
I have my NHibernate mappings set to lazy loading = true. In my CustomersViewModel
I Use EF Code First, and lazy loading. My problem relates to how to
I have this bean: @ManagedBean(name=langListing) @ViewScoped public class LangListing implements Serializable { private List<SelectItem>

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.