On Tue, 9 Jan 2001, Colin Chalmers wrote:

> Been playing about with the latest version of Turbine and specifically the
> database connection. Unfortunately I get the following exception. It's
> probably something to do with the way I defined the criteria??? Anyway it
> appears that the name of the table where the query should take place is
> null.
> 
> Any tips?

That should be:

crit.add(TurbineUserPeer.LAST_NAME, "chalmers");

which translates to

crit.add("TURBINE_USER.LAST_NAME", "chalmers");

The criteria needs the table in there, you can do
it manually, but it is best to use the constants
defined in the peer class for the object type
you are trying to retrieve.

jvz.
 
> /colin
> 
> 
> <this code works>
>      TurbineUser user = (TurbineUser)TurbineSecurity.getUser("Marielle");
> </this code works>
> 
> <this gives exception>
>    String dbName =  TurbineDB.getDefaultDB();
>    Criteria crit = new Criteria(dbName);
>    crit.add("LAST_NAME", "chalmers");
> 
>    User []  chalmUsers = TurbineSecurity.getUsers(crit);
> </this gives exception>
> 
> java.lang.NullPointerException at
> org.apache.turbine.om.peer.BasePeer.createQueryString(BasePeer.java:899) at
> org.apache.turbine.om.peer.BasePeer.doSelect(BasePeer.java:1015) at
> org.apache.turbine.om.security.peer.TurbineUserPeer.doSelect(TurbineUserPeer
> .java:287) at
> org.apache.turbine.om.security.peer.TurbineUserPeer.doSelect(TurbineUserPeer
> .java:235) at
> org.apache.turbine.services.security.DBUserManager.retrieve(DBUserManager.ja
> va:201) rethrown as org.apache.turbine.util.security.DataBackendException:
> Failed to retrieve users at
> org.apache.turbine.services.security.DBUserManager.retrieve(DBUserManager.ja
> va:205) at
> org.apache.turbine.services.security.BaseSecurityService.getUsers(BaseSecuri
> tyService.java:330) at
> org.apache.turbine.services.security.TurbineSecurity.getUsers(TurbineSecurit
> y.java:227) at
> com.maxware.fls.utils.xmlWorker.dataBaseTest(xmlWorker.java:228)
> 
> 
> 
> 
> ------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
> Problems?:           [EMAIL PROTECTED]
> 
> 



------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to