• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mapping strategy

 
Prabu Vs
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • 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


 
Devaka Cooray
Marshal
Pie
Posts: 4894
408
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic