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: Need help to Inner Join
PostPosted: Sat Mar 07, 2009 6:49 am 
Newbie

Joined: Thu Dec 18, 2008 3:09 am
Posts: 11
Location: Visakhapatnam
Hi,

I have four tables Accounts, Users, Role and AccountRoles in database. In table fields are

Accounts:

AccountId,
UserId,
LoginId,
Password,
etc.,

Users:

UserId,
FirstName,
LastName,
EmailId,
etc.,

Role:

RoleId,
Roles,
Description,
etc.,

AccountRoles:

AccountRoleId,
AccountId,
RoleId,
etc.,

I retrieve Roles Using LoginId and Password. I am using inner join in sql server. It is working. the Join is:

select Accounts.LoginId,Accounts.Password, Roles.Roles from Roles inner join (AccountRoles inner join (Accounts Inner Join Users on Accounts.UserId=Users.Userid) on AccountRoles.AccountId=Accounts.AccountId) on Roles.RoleId=AccountRoles.Roleid where (((Accounts.Loginid)='general' and (Accounts.password)='general'));

This Join is working in sql server 2005.

In hibernate how to modify in this join and how to write Data Access Layer to Retrieving Roles. Please Explain me or give me any article to near to regarding this.


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.