• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

many 2 many relastionship with extra columns

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so I have followed this page and it is now working for findAll https://www.mkyong.com/hibernate/hibernate-many-to-many-example-join-table-extra-column-annotation/

but what I can find nowhere to tell me is how to use the extra column in the where section of a select, in My DAO.

so taking the stock example in that page I only want to select stock that was stocked by Fred.

findByUser (for example)

here are the tables from the example:


I have found pages to help me get so far but every tutorial appears to be missing this vital fact. Could somebody help point me further.

if I knew hibernate well the answer may be obvious but I don't.

what I have tried so far is nothing, as I have 0 idea where to start.

 
Rancher
Posts: 4576
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you know how HQL syntax works?
 
Wendy Gibbons
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:Do you know how HQL syntax works?




Sorry I was just trying to close this and open a more specific question, as things have moved on.

I am trying to do it via criteria (once I found the code that needed changing)

and a new question stops people reading this and answering the old question
 
You showed up just in time for the waffles! And this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic