Fixed broken SQL statement in ThdlUserRepository to select a single user role per user/application

This commit is contained in:
dubtraxis 2003-10-18 15:16:40 +00:00
parent 3d20b50e42
commit 050ac0134c

View file

@ -118,12 +118,11 @@ public class ThdlUserRepository
{ {
ThdlUser thdlUser = validate( user ); ThdlUser thdlUser = validate( user );
String sql = "SELECT UserRolesForApplication.roles " String sql = "SELECT urfa.roles "
+ "FROM UserRolesForApplication, Applications " + "FROM UserRolesForApplication AS urfa, Applications AS apps "
+ "LEFT JOIN UserRolesForApplication AS urfa ON urfa.applicationId = Applications.id " + "WHERE urfa.applicationId = apps.id "
+ "WHERE Applications.application = '" + application + "'" + "AND apps.application = '" + application + "' "
+ "AND urfa.userId = " + thdlUser.getId() + " "; + "AND urfa.userId = " + thdlUser.getId() + " ";
try try
{ {
Statement stmt = getConnection().createStatement(); Statement stmt = getConnection().createStatement();