From 2ace74d1047e87d695725dec083bc403de4cc7e0 Mon Sep 17 00:00:00 2001 From: Andreas Reichel Date: Tue, 11 Jun 2024 05:02:19 +0700 Subject: [PATCH] feat: add syntax sugar Signed-off-by: Andreas Reichel --- .../net/sf/jsqlparser/expression/IntervalExpression.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/net/sf/jsqlparser/expression/IntervalExpression.java b/src/main/java/net/sf/jsqlparser/expression/IntervalExpression.java index 26584c63d..6ae374fe7 100644 --- a/src/main/java/net/sf/jsqlparser/expression/IntervalExpression.java +++ b/src/main/java/net/sf/jsqlparser/expression/IntervalExpression.java @@ -28,6 +28,13 @@ public IntervalExpression(boolean intervalKeyword) { this.intervalKeyword = intervalKeyword; } + public IntervalExpression(int value, String type) { + this.parameter = null; + this.intervalKeyword = true; + this.expression = new LongValue(value); + this.intervalType = type; + } + public boolean isUsingIntervalKeyword() { return intervalKeyword; }