• 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

Hibernate Mapping Strategy

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having trouble figuring out how to logically create the following entity association.

I have 2 entities. A User and an Event.

1) Each event needs to have a set of users.
2) Each user needs to have a set of users.
3) Each of the user sets per user need to relate to a unique event.

I know how to technically create #1 and #2 but when then having a subset of a set of user per event is driving me nuts in how to impliment that.


If anyone has any ideas, that would be extremely appreciated!

Thanks!
 
Joshua Elkino
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So i think i have logically figured this out, but i need assitance technically.

Logically I created another entity called AttendanceListEnt. This entity will house the user that owns this list, the event it relates to and the lsit of users.


In my UserEnt I added.


I have not modified anything in the EventEnt.
Now i get this error when running.
org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: AttendanceListEnt, for columns: [org.hibernate.mapping.Column(userList)]

I think the whole set inside a set has confused me so if anyone can help me out i would highly appreciate it!

Thanks!
 
Joshua Elkino
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well i found a fix to that error.
In the AttendanceList entity I now have.



This resulted in 2 tables
attendancelist_userent
-AttendanceListEnt_id
-userList_id

and

attendancelist
-id
-event_id
-user_id

Unfortunately i was extecting more tables! Tables to cover the ...

... sets.
Am i right in thinking this would give me more? How can i accomplish this?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic