File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
doma-core/src/main/java/org/seasar/doma/jdbc Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -509,7 +509,15 @@ public void visit(ArithmeticExpression.Div<?> div) {
509509
510510 @ Override
511511 public void visit (ArithmeticExpression .Mod <?> mod ) {
512- binaryOperator (mod .getName (), mod .left , mod .right );
512+ if (config .getDialect ().supportsModOperator ()) {
513+ binaryOperator (mod .getName (), mod .left , mod .right );
514+ } else {
515+ buf .appendSql ("mod(" );
516+ mod .left .accept (operandVisitor );
517+ buf .appendSql (", " );
518+ mod .right .accept (operandVisitor );
519+ buf .appendSql (")" );
520+ }
513521 }
514522
515523 @ Override
Original file line number Diff line number Diff line change @@ -149,6 +149,15 @@ default boolean supportsAliasInUpdateClause() {
149149 return false ;
150150 }
151151
152+ /**
153+ * Whether this object supports mod operator {@code %}.
154+ *
155+ * @return {@code true}, if this object supports it
156+ */
157+ default boolean supportsModOperator () {
158+ return true ;
159+ }
160+
152161 /**
153162 * Returns an SQL object to get IDENTITY values that are generated in the database.
154163 *
Original file line number Diff line number Diff line change @@ -159,6 +159,11 @@ public boolean supportsResultSetReturningAsOutParameter() {
159159 return true ;
160160 }
161161
162+ @ Override
163+ public boolean supportsModOperator () {
164+ return false ;
165+ }
166+
162167 @ Override
163168 public JdbcType <ResultSet > getResultSetType () {
164169 return RESULT_SET ;
You can’t perform that action at this time.
0 commit comments