Package java.sql

Examples of java.sql.Date


  public void testXmlCalendarZ()
    throws Exception
  {
    String NS = "http://example.org/rdf/";
    int OFFSET = TimeZone.getDefault().getOffset(new Date(2007, Calendar.NOVEMBER, 6).getTime()) / 1000 / 60;
    String SELECT_BY_DATE = "SELECT ?s ?d WHERE { ?s <http://www.w3.org/1999/02/22-rdf-syntax-ns#value> ?d . FILTER (?d <= ?date) }";
    DatatypeFactory data = DatatypeFactory.newInstance();
    for (int i = 1; i < 5; i++) {
      URI uri = vf.createURI(NS, "date" + i);
      XMLGregorianCalendar xcal = data.newXMLGregorianCalendar();
View Full Code Here


          dateStr = dateBuf.toString();
        }
        return Date.valueOf(dateStr);
      }
    } else if (value instanceof java.util.Date) {
      return new Date(((java.util.Date) value).getTime());
    } else {
      return null;
    }
  }
View Full Code Here

    put("user", user);
    return forward();
  }

  public String welcome() {
    put("date", new Date(System.currentTimeMillis()));
    put("user", SecurityUtils.getFullname());
    return forward();
  }
View Full Code Here

    entityDao.remove(entityDao.get(codeClass, codeIds));
  }

  public void saveOrUpdate(BaseCode<?> code) {
    if (code.isTransient()) {
      code.setCreatedAt(new Date(System.currentTimeMillis()));
    }
    code.setUpdatedAt(new Date(System.currentTimeMillis()));
    entityDao.saveOrUpdate(code);
  }
View Full Code Here

        "edit", "error.notUnique"); }
    if (!group.isPersisted()) {
      User creator = userService.get(getUserId());
      userService.createGroup(creator, group);
    } else {
      group.setUpdatedAt(new Date(System.currentTimeMillis()));
      if (!group.isPersisted()) {
        group.setCreatedAt(new Date(System.currentTimeMillis()));
      }
      entityDao.saveOrUpdate(group);
    }
    return redirect("search", "info.save.success");
  }
View Full Code Here

    // no default in DB.  If nullable, use null.
    if (_isNullable)
      return null;

    // field is not nullable, so create a reasonable default value
    return new Date( new java.util.Date().getTime());
  }
View Full Code Here

  public void testUseDefaultDateFormatAfterLoadingProperties() throws Exception
  {
    resetPropertiesLoadedFlag();
    DTProperties.put(DataTypeDate.class.getName(), "useJavaDefaultFormat", "true");
    classUnderTest = new DataTypeDate(null, getMockColumnDisplayDefinition());
    Date currentDate = Date.valueOf("2010-10-15");
    String renderedDate = classUnderTest.renderObject(currentDate);
    assertEquals("Must use the default format", "2010-10-15", renderedDate);
  }
View Full Code Here

    DTProperties.put(DataTypeDate.class.getName(), "useJavaDefaultFormat", "false");
    DTProperties.put(DataTypeDate.class.getName(), "localeFormat", "" + DateFormat.MEDIUM);
    DTProperties.put(DataTypeDate.class.getName(), "lenient", "false");
    classUnderTest = new DataTypeDate(null, getMockColumnDisplayDefinition());
   
    Date currentDate = Date.valueOf("2010-10-15");
    String expectedDate = DateFormat.getDateInstance(userDefinedDateFormat).format(currentDate);
    String renderedDate = classUnderTest.renderObject(currentDate);
    assertEquals("Must use the user defined format", expectedDate, renderedDate);
  }
View Full Code Here

  }

  @Override
  protected Object getEqualsTestObject()
  {
    return new Date(System.currentTimeMillis());
  }
View Full Code Here

    }
    return users.size();
  }

  public void saveOrUpdate(User user) {
    user.setUpdatedAt(new Date(System.currentTimeMillis()));
    if (!user.isPersisted()) {
      user.setCreatedAt(new Date(System.currentTimeMillis()));
    }
    entityDao.saveOrUpdate(user);
    publish(new UserAlterationEvent(Collections.singletonList(user)));
  }
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.