Package java.sql

Examples of java.sql.Date


    return entityDao.search(builder);
  }

  public void createUser(User creator, User newUser) {
    newUser.setCreator(creator);
    newUser.setUpdatedAt(new Date(System.currentTimeMillis()));
    newUser.setCreatedAt(new Date(System.currentTimeMillis()));
    entityDao.saveOrUpdate(newUser);
    publish(new UserCreationEvent(Collections.singletonList(newUser)));
  }
View Full Code Here


  public boolean isManagedBy(User manager, User user) {
    return (isAdmin(manager) || manager.equals(user.getCreator()));
  }

  public void createGroup(User owner, Group group) {
    group.setUpdatedAt(new Date(System.currentTimeMillis()));
    group.setCreatedAt(new Date(System.currentTimeMillis()));
    group.setOwner(owner);
    group.getMembers().add(new GroupMemberBean(group, owner, GroupMember.Ship.MANAGER));
    entityDao.saveOrUpdate(group);
    publish(new GroupCreationEvent(group));
  }
View Full Code Here

    int year = 2010;
    int month = 9;
    int day = 1;
    datas.put("birthday", year + "-" + month + "-" + day);

    Date birthday = converter.get(datas, "birthday", Date.class);
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(birthday);
    assertEquals(calendar.get(Calendar.YEAR), year);
    assertEquals(calendar.get(Calendar.MONTH), month - 1);
    assertEquals(calendar.get(Calendar.DAY_OF_MONTH), day);

    datas.put("birthday", new Date[] { birthday });
    Date birthday2 = converter.get(datas, "birthday", Date.class);
    assertEquals(birthday, birthday2);
  }
View Full Code Here

    assertNull(ConvertUtils.convert("", Long.class));
  }

  private void converToDate(String dateStr, int year, int month, int day) {
    Converter c = new SqlDateConverter();
    Date date = (Date) c.convert(Date.class, dateStr);
    Calendar calendar = new GregorianCalendar();
    calendar.setTime(date);
    assertEquals(calendar.get(Calendar.YEAR), year);
    assertEquals(calendar.get(Calendar.MONTH), month);
    assertEquals(calendar.get(Calendar.DAY_OF_MONTH), day);
View Full Code Here

   *
   * @throws  SQLException  SQL error occured.
   */
  public Date getDate(int columnIdx) throws SQLException
  {
    final Date results = _rs.getDate(columnIdx);
    _wasNull = results == null;
    return results;
  }
View Full Code Here

    Map parameters = new HashMap();
    parameters.put(JRJpaQueryExecuterFactory.PARAMETER_JPA_ENTITY_MANAGER, em);
    parameters.put("ReportTitle", "JRMDb - The JasperReports Movie Database");
    Calendar calendar = Calendar.getInstance();
    calendar.set(1990, 1, 1);
    parameters.put("DateFrom", new Date(calendar.getTimeInMillis()));
    parameters.put("DateTo", new Date(System.currentTimeMillis()));
    parameters.put("OrderClause", "m.genre, m.title");
   
    return parameters;
  }
View Full Code Here

  public Date getValue(String value) {

    try {
      java.util.Date utilDate = this.dateFormat.parse(value);
     
      return new Date(utilDate.getTime());
     
    } catch (ParseException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

        if (cal != null) {
            millis = HsqlDateTime.convertMillisToCalendar(cal, millis);
        }

        return new Date(millis);
    }
View Full Code Here

            "INSERT INTO WAEHLER (NAME, AUSTRITTSDATUM) VALUES (?,?)");

        Calendar cal = GregorianCalendar.getInstance();

        p.setString(1, "Muster3");
        p.setDate(2, new Date(cal.getTimeInMillis()), cal);
        p.execute();
        p.close();
        System.out.println("END INSERT INTO WAEHLER");
        System.out.println("DELETE FROM WAEHLER START ...");
View Full Code Here

        if (cal != null) {
            millis = HsqlDateTime.convertMillisToCalendar(cal, millis);
        }

        return new Date(millis);
    }
View Full Code Here

TOP

Related Classes of java.sql.Date

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.