Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

OneToMany not by ID

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having problems with the OneToMany side of a relation.

2 models (with the appropiate getters and setters)





If I make the query from City table, I have no problem.

But I'm trying this.



and Hibernate (with Oracle) makes a Query like this.

select * from ( select this_.Serial as Serial2_0_, this_.CodeRegion as CodeRe2_2_0_, this_.DescRegion as DescRe3_2_0_ from region this_ where exists (select 1 from city where this_.Serial=CodeRegion) ) where rownum <= ?

I noted that part in Black as is using Serial column not using the CodeRegion

Any way to substitute the black part from this_.Serial to this_.CodeRegion?

 
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not know if this will help but,

try this:

 
Alex Armenteros
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've tried with no result but...


if I use something like this.




It works my way and your way [Not using mappedBy or using it] so... I suppose there is some kind of bug in "isNotEmpty" function.

Thank you for your time answering me.
 
Won't you be my neighbor? - Fred Rogers. tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic