Good point! As I mentioned, I haven't tried this out yet, myself. However, I found the following snippet of code in RolePeer.java that seems to demonstrate a way of doing this:
UserPeer up = ((DBSecurityService)TurbineSecurity.getService()).getUserPeerInstance(); criteria.add(up.getFullColumnName(UserPeer.USERNAME), user.getUserName()); ... I don't know if I am steering you down the wrong path or not. I am guessing that the get UserPeerInstance() method is not available in the TurbineSecurity facade class because it is specific to the database implementation (DBSecurityService.java)??? Perhaps someone else who has already solved this problem can respond if this is not the correct way of doing this... Kevin > -----Original Message----- > From: Will Glass-Husain [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 18, 2002 1:33 PM > To: Turbine Users List > Subject: RE: Sorting a list of users -- exception > > > Good idea, but how do I get the instance of UserPeer? > (getFullColumnName > isn't a static method). > > Sorry if this is a basic question... just figuring some of this out. > > Thanks, WILL > > -----Original Message----- > From: Kevin Rutherford [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 18, 2002 11:19 AM > To: 'Turbine Users List' > Subject: RE: Sorting a list of users -- exception > > > I believe the problem is that addAscendingOrderByColumn() is > expecting a > full table/column name, but the User and UserPeer abstraction > classes do not > include the table name (intentionally, I think). > > Try > addAscendingOrderByColumn(UserPeer.getFullColumnName(UserPeer. > USERNAME)). I > haven't tried this myself (we use TurbineUserPeer.USERNAME, > which works but > is not the right way to do it), but it looks like the > getFullColumnName() > method was created to solve this issue. > > Kevin > > > -----Original Message----- > > From: Will Glass-Husain [mailto:[EMAIL PROTECTED]] > > Sent: Monday, February 18, 2002 11:52 AM > > To: Turbine Users List; [EMAIL PROTECTED] > > Subject: RE: Sorting a list of users -- exception > > > > > > Hi, > > > > Thanks for the note. You're right, should have tried > > UserPeer.USERNAME. > > Tried again, still gave the same error. Possible bug? > > > > Criteria crit2 = new Criteria(); > > crit2.addAscendingOrderByColumn(UserPeer.USERNAME); > > User[] UserList = TurbineSecurity.getUsers(crit2); > > context.put("UserList",UserList); > > Thanks. > > > > WILL > > > > -----Original Message----- > > From: Colm McCartan [mailto:[EMAIL PROTECTED]] > > Sent: Monday, February 18, 2002 10:22 AM > > To: Turbine Users List > > Subject: Re: Sorting a list of users -- exception > > > > > > > > > > Will Glass-Husain wrote: > > > > > Hi, > > > > > > I tried to put a sorted list of users in my Velocity > > context, and got an > > > exception > > > > > > Criteria crit2 = new Criteria(); > > > crit2.addAscendingOrderByColumn(User.USERNAME); > > > > > > Are you sure you meant this and not UserPeer.USERNAME? > > > > > > > > colm > > > > > > > > -- > > To unsubscribe, e-mail: > > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > > > -- > > To unsubscribe, e-mail: > > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]> >
