File tree Expand file tree Collapse file tree 2 files changed +23
-14
lines changed
main/java/net/sf/jsqlparser/expression
test/java/net/sf/jsqlparser/test/select Expand file tree Collapse file tree 2 files changed +23
-14
lines changed Original file line number Diff line number Diff line change 2828 */
2929public class DateValue implements Expression {
3030
31- private Date value ;
31+ private Date value ;
3232
33- public DateValue (String value ) {
34- this .value = Date .valueOf (value .substring (1 , value .length () - 1 ));
35- }
33+ public DateValue (String value ) {
34+ this .value = Date .valueOf (value .substring (1 , value .length () - 1 ));
35+ }
3636
37- @ Override
38- public void accept (ExpressionVisitor expressionVisitor ) {
39- expressionVisitor .visit (this );
40- }
37+ @ Override
38+ public void accept (ExpressionVisitor expressionVisitor ) {
39+ expressionVisitor .visit (this );
40+ }
4141
42- public Date getValue () {
43- return value ;
44- }
42+ public Date getValue () {
43+ return value ;
44+ }
4545
46- public void setValue (Date d ) {
47- value = d ;
48- }
46+ public void setValue (Date d ) {
47+ value = d ;
48+ }
49+
50+ @ Override
51+ public String toString () {
52+ return "{d '" + value .toString () + "'}" ;
53+ }
4954}
Original file line number Diff line number Diff line change @@ -879,6 +879,10 @@ public void testTime() throws JSQLParserException {
879879 (((TimeValue ) ((GreaterThan ) plainSelect .getWhere ()).getRightExpression ()).getValue ()).toString ());
880880 assertStatementCanBeDeparsedAs (select , statement );
881881 }
882+
883+ public void testBetweenDate () throws JSQLParserException {
884+ assertSqlCanBeParsedAndDeparsed ("SELECT * FROM mytable WHERE col BETWEEN {d '2015-09-19'} AND {d '2015-09-24'}" );
885+ }
882886
883887 public void testCase () throws JSQLParserException {
884888 String statement = "SELECT a, CASE b WHEN 1 THEN 2 END FROM tab1" ;
You can’t perform that action at this time.
0 commit comments