Package at.fhj.itm.model

Examples of at.fhj.itm.model.User


    int seats = set.getByte("seats");
    int userId = set.getInt("user_id");
    int waypoint = set.getInt("waypoint");
    String copyright = set.getString("copyright");

    User user = userDao.getByID(userId, connection);
    Waypoint wp = waypointDAO.getByID(waypoint, connection);

    return new Trip(id, user, departureDate, seats, wp, copyright);
  }
View Full Code Here


    java.util.Date lastLogin = set.getTimestamp("last_login");
    String session = set.getString("session");

    Location tmp_location = this.locationDAO.getByID(location, connection);

    return new User(id, firstName, lastName, userName, password, eMail,
        phone, tmp_location, lastLogin, session);

  }
View Full Code Here

      List<User> users = new ArrayList<User>();
      PreparedStatement stmt = connection.prepareStatement(GET_ALL_USERS);
      ResultSet res = stmt.executeQuery();
      while (res.next()) {
        User u = getFromResultSet(res, connection);
        users.add(u);
      }

      stmt.close();
      return Collections.unmodifiableList(users);
View Full Code Here

      PreparedStatement stmt = connection
          .prepareStatement(GET_USER_BY_MAIL_AND_PASSWORD);
      stmt.setString(1, email);
      stmt.setString(2, password);
      ResultSet res = stmt.executeQuery();
      User user = null;
      if (res.next()) {
        user = getFromResultSet(res, connection);
      }
      res.close();
      stmt.close();
View Full Code Here

    try {
      PreparedStatement stmt = connection
          .prepareStatement(GET_USER_BY_SESSION_ID);
      stmt.setString(1, sessionId);
      ResultSet res = stmt.executeQuery();
      User user = null;
      if (res.next()) {
        user = getFromResultSet(res, connection);
      }
      res.close();
      stmt.close();
View Full Code Here

      PreparedStatement stmt = connection
          .prepareStatement(GET_USER_BY_MAIL_AND_PHONE);
      stmt.setString(1, email);
      stmt.setString(2, phone);
      ResultSet res = stmt.executeQuery();
      User user = null;
      if (res.next()) {
        user = getFromResultSet(res, connection);
      }
      res.close();
      stmt.close();
View Full Code Here

    try {
      PreparedStatement stmt = connection
          .prepareStatement(GET_USER_BY_ID);
      stmt.setInt(1, id);
      ResultSet res = stmt.executeQuery();
      User user = null;
      while (res.next()) {
        user = getFromResultSet(res, connection);
      }
      res.close();
      stmt.close();
View Full Code Here

      PreparedStatement stmt = connection
          .prepareStatement(GET_USER_BY_MAIL_AND_USERNAME);
      stmt.setString(1, email);
      stmt.setString(2, username);
      ResultSet res = stmt.executeQuery();
      User user = null;
      if (res.next()) {
        user = getFromResultSet(res, connection);
      }
      res.close();
      stmt.close();
View Full Code Here

   * @throws Exception
   */
  @Before
  public void setUp() throws Exception {
    departure = new Date();
    mockTripCreator = new User("Trip","Creator","","","","",null,null, "");
    fromLocation = new Location(1,1000,"City1");
    toLocation = new Location(2,2000,"City2");
    mockTripWaypoint = new Waypoint(1,fromLocation,toLocation,mockTripCreator,"",true);
    mockTrip4Seats = new Trip(1,mockTripCreator,departure,4,mockTripWaypoint,"");
    mockTripBooker = new User("Trip", "Booker", "", "", "", "", null, null, "");
    mockBookerWaypointInactive = new Waypoint(fromLocation,toLocation,mockTripBooker,"",false);
    mockJsfUtil = EasyMock.createMock(JsfUtil.class);
    mockGoogleUtil = EasyMock.createMock(GoogleUtil.class);
    mockTripDAO = EasyMock.createMock(TripDAO.class);
    mockWaypointDAO = EasyMock.createMock(WaypointDAO.class);
View Full Code Here

  /**
   * Creates a fully fledged Waypoint which can be used by test cases
   * @return
   */
  private Waypoint createTestWaypoint(){
    User u = userDAO.getByID(1,connection);
    Location from = new Location(8190, "Birkfeld");
    Location to = new Location(8010, "Graz");
    Waypoint wp = new Waypoint(from, to, u, "Unit Test", true);
    return wp;
  }
View Full Code Here

TOP

Related Classes of at.fhj.itm.model.User

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.