I am experience a problem with a query.

Previous to save data to database, i try to find if there is already data
related to the user:

The final query, in UserDataDao.java is this:

public UserData findByIdClient(long userId) throws NoSuchUserDataException {
    List<UserData> usersData = getHibernateTemplate().find("from UserData ud
where ud.userId = ?", userId);
    if ((usersData == null) || usersData.isEmpty()) {
        log.error("No existen datos del usuario con userId " + userId);
        throw new NoSuchUserDataException("No existen datos del usuario con 
userId
" + userId);
    } 
    return usersData.get(0);
}
 And it always return that the list is empty, even when there is data stored
in the database, associated with the user, and overwrite the record.

I followed the tutorial. What I am doing wrong? I am trying to access with
the default admin -2. and the access to the database i am doing it from the
listener, but if it can write the data, it must read it. I don't know :(

Cheers.
-- 
View this message in context: 
http://appfuse.547863.n4.nabble.com/Trying-to-save-some-data-in-database-when-login-tp2022951p2223057.html
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@appfuse.dev.java.net
For additional commands, e-mail: users-h...@appfuse.dev.java.net

Reply via email to