Hi,
I am using Hibernate version: 2.1 and I have been banging my head against a wall all week on this so any help is much appeciated.
I have a table which specifies which organisations can see the data owned by others using the following table:
event_permission
owner_org_id,
access_org_id
e.g 1,2 would be organisation 2 has access to events owned by organisation 1.
I also have an event table with an owner-id, this owner owns the event.
event
id,
owner-id
What I am wanting to do is to select all the events to which the currently logged in user has access, in SQL:
select evt.id from event evt, event_permission evp
where evt.owner-id = evp.owner-id
and evp.access_org_id = {the organisation of the logged in user}
The reason I am having troouble is that I know I need to join to the event_permission table but I dont have any attibutes on event to map to and I dont really want to have a class in order to map the event_permissions since I dont need the objects.
Any help would be much appreciated.
Regards
Lea.
|