public T getUserById()

in torque/src/java/org/apache/fulcrum/security/torque/turbine/TorqueTurbineUserManagerImpl.java [313:355]


  public <T extends User> T getUserById(Object id) throws DataBackendException, UnknownEntityException
  {
      T user;

      if (id != null && id instanceof Integer)
      {
          Connection con = null;

          try
          {
              con = Transaction.begin();

              user = doSelectById((Integer)id, con);

              // Add attached objects if they exist
              attachRelatedObjects( user, con ); 

              Transaction.commit(con);
              con = null;
          }
          catch (NoRowsException e)
          {
              throw new UnknownEntityException("User with id '" + id + "' does not exist.", e);
          }
          catch (TorqueException e)
          {
              throw new DataBackendException("Error retrieving user information", e);
          }
          finally
          {
              if (con != null)
              {
                  Transaction.safeRollback(con);
              }
          }
      }
      else
      {
          throw new UnknownEntityException("Invalid user id '" + id + "'");
      }

      return user;
  }