• 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

Mapping strategy

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm unable to work out an appropriate mapping strategy for the below scenario.
Following are the DB tables and the java code i want them to map.

Any pointers would be of great help.

GROUP
groupid | name
1 | group1
2 | group2

GROUP_OBJ
groupid | objecttype | objectid
1 OBJ1 1
1 OBJ1 2
1 OBJ2 1
1 OBJ3 3
2 OBJ1 1
2 OBJ2 2


 
Sheriff
Posts: 7135
1360
IntelliJ IDE jQuery Eclipse IDE Postgres Database Tomcat Server Chrome Google App Engine
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch,

You can use the 'Joined' strategy with the given many-to-many relationship.
 
Prabu Vs
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your response.
Can you give pointers to some example or pseudo xml mapping

I want to access (set/get) objectIds based on Object type.

group.setObjectIds(ObjectType, Collection<ObjectIds>)

Collection<ObjectIds> group.getObjectIds(ObjectType)

ObjectType is an enum
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic