• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Combination of many-to-many and findAll

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Guys,

I am new to Hibernate and I am stuck in a problem. I have three tables.

USER

USER_ID
------------
1
2



FEATURE

FEATURE_ID
----------------
1
2
3
4
5
6


and the many-to-many table.

USER_FEATURE


USER_ID FEATURE_ID
------------|------------------
1.............|...............1
1.............|...............2


The problem is that the semantics of my scheme are different. User has access to all features (1,2,3,4,5,6). But the many-to-many table means which Features need attention. In other words, many-to-many table acts as a flag.

I want a method to which I can pass a user object. If I pass the user with USER_ID 1, the result should be 1(ON), 2(ON), 3(OFF), 4(OFF), 5(OFF), 6(OFF).


The Feature class will have two properties.

Feature
-----------
FeatureId
AttentionFlag (user-based)



Please help.
Thanks,

Kashif
 
Never trust an airline that limits their passengers to one carry on iguana. Put this tiny ad in your shoe:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic