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 28
28
*/
29
29
public class DateValue implements Expression {
30
30
31
- private Date value ;
31
+ private Date value ;
32
32
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
+ }
36
36
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
+ }
41
41
42
- public Date getValue () {
43
- return value ;
44
- }
42
+ public Date getValue () {
43
+ return value ;
44
+ }
45
45
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
+ }
49
54
}
Original file line number Diff line number Diff line change @@ -879,6 +879,10 @@ public void testTime() throws JSQLParserException {
879
879
(((TimeValue ) ((GreaterThan ) plainSelect .getWhere ()).getRightExpression ()).getValue ()).toString ());
880
880
assertStatementCanBeDeparsedAs (select , statement );
881
881
}
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
+ }
882
886
883
887
public void testCase () throws JSQLParserException {
884
888
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