These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Joining with unmapped class.
PostPosted: Thu Nov 11, 2004 4:50 pm 
Newbie

Joined: Thu Nov 11, 2004 12:09 pm
Posts: 2
Location: Derbyshire, UK
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.