This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

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: 4304
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
 
and POOF! You're gone! But look, this tiny ad is still here:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!