• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate manyToMany, find object not linked

 
saad bousf
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have two Hibernate entities with manyToMany Relation between them: Product and Category.

I want to find Product who are NOT linked with ANY Category, using DetachedCriteria.

these are my two object:






I tried the following without succes:


Please, help!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35269
383
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know that you can. A many-to-many relationship isn't going to match on links that don't exist. (An outer join would, but that's not what you have here). Which means what you want to know isn't in the many-to-many relationship cache in the first place.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic