Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Eager Fetching not working

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate is not fetching the required field mediaid from joined table ...... with underlined code.





Current Table structure is following:

SELECT DISTINCT brand0_.id AS id1_26_,
   brand0_.CREATED_BY         AS CREATED_BY2_26_,
   brand0_.CREATED_DATE       AS CREATED_DATE3_26_,
   brand0_.IS_DELETED         AS IS_DELETED4_26_,
   brand0_.MODIFIED_BY        AS MODIFIED_BY5_26_,
   brand0_.MODIFIED_DATE      AS MODIFIED_DATE6_26_,
   brand0_.VERSION            AS VERSION7_26_,
   brand0_.OWNER_ID           AS OWNER_ID14_26_,
   brand0_.MEDIAOCEAN_ID      AS MEDIAOCEAN_ID8_26_,
   brand0_.NAME               AS NAME9_26_,
   brand0_.PARENT_ID          AS PARENT_ID15_26_,
   brand0_.SHORT_NAME         AS SHORT_NAME10_26_,
   brand0_.STATUS             AS STATUS11_26_,
   brand0_.THIRD_PARTY_ID     AS THIRD_PARTY_ID12_26_,
   brand0_.TYPE_ID            AS TYPE_ID13_26_,



AND AIM IS TO MAKE FOLLOWING IN JPA....

SELECT DISTINCT brand0_.id,media3_.id AS id1_26_,
   brand0_.CREATED_BY         AS CREATED_BY2_26_,
   brand0_.CREATED_DATE       AS CREATED_DATE3_26_,
   brand0_.IS_DELETED         AS IS_DELETED4_26_,
   brand0_.MODIFIED_BY        AS MODIFIED_BY5_26_,
   brand0_.MODIFIED_DATE      AS MODIFIED_DATE6_26_,
   brand0_.VERSION            AS VERSION7_26_,
   brand0_.OWNER_ID           AS OWNER_ID14_26_,
   brand0_.MEDIAOCEAN_ID      AS MEDIAOCEAN_ID8_26_,
   brand0_.NAME               AS NAME9_26_,
   brand0_.PARENT_ID          AS PARENT_ID15_26_,
   brand0_.SHORT_NAME         AS SHORT_NAME10_26_,
   brand0_.STATUS             AS STATUS11_26_,
   brand0_.THIRD_PARTY_ID     AS THIRD_PARTY_ID12_26_,
   brand0_.TYPE_ID            AS TYPE_ID13_26_,
 
    Bookmark Topic Watch Topic
  • New Topic