@Test public void Dateの値をリテラルに変換する() throws Exception { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); assertThat(target.convert(format.parse("2011-11-01")), is("'2011-11-01'")); }
@Override public String convert(Date target) { Args.checkNotNull(target); SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd"); StringBuilder builder = new StringBuilder(); builder.append(QUOTE_STRING); builder.append(f.format(target)); builder.append(QUOTE_STRING); return builder.toString(); }
DateLiteralConvertor implements LiteralConvertor<Date> { @Override public String convert(Date target) { Args.checkNotNull(target); SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd"); StringBuilder builder = new StringBuilder(); builder.append(QUOTE_STRING); builder.append(f.format(target)); builder.append(QUOTE_STRING); return builder.toString(); } }
DateLiteralConvertor implements LiteralConvertor<Date> { @Override public String convert(Date target) { Args.checkNotNull(target); SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd"); StringBuilder builder = new StringBuilder(); builder.append(QUOTE_STRING); builder.append(f.format(target)); builder.append(QUOTE_STRING); return builder.toString(); } DateLiteralConvertor(); }
DateLiteralConvertor implements LiteralConvertor<Date> { @Override public String convert(Date target) { Args.checkNotNull(target); SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd"); StringBuilder builder = new StringBuilder(); builder.append(QUOTE_STRING); builder.append(f.format(target)); builder.append(QUOTE_STRING); return builder.toString(); } DateLiteralConvertor(); @Override /* * (non-Javadoc) * @see jp.co.ctc_g.jfw.core.jdbc.mybatis.LiteralConvertor#convert(java.lang.Object) */ String convert(Date target); @Override /* * (non-Javadoc) * @see jp.co.ctc_g.jfw.core.jdbc.mybatis.LiteralConvertor#getJavaType() */ Class<?> getJavaType(); }
DateLiteralConvertor implements LiteralConvertor<Date> { @Override public String convert(Date target) { Args.checkNotNull(target); SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd"); StringBuilder builder = new StringBuilder(); builder.append(QUOTE_STRING); builder.append(f.format(target)); builder.append(QUOTE_STRING); return builder.toString(); } DateLiteralConvertor(); @Override /* * (non-Javadoc) * @see jp.co.ctc_g.jfw.core.jdbc.mybatis.LiteralConvertor#convert(java.lang.Object) */ String convert(Date target); @Override /* * (non-Javadoc) * @see jp.co.ctc_g.jfw.core.jdbc.mybatis.LiteralConvertor#getJavaType() */ Class<?> getJavaType();  }