From 929c43ec55df4e8c176794609e01ea5fedff64be Mon Sep 17 00:00:00 2001 From: zhouhao Date: Thu, 14 Dec 2023 17:19:59 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20EnumInFragmentBuilder=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0ofNot?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fragments/term/EnumInFragmentBuilder.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/hsweb-easy-orm-rdb/src/main/java/org/hswebframework/ezorm/rdb/operator/builder/fragments/term/EnumInFragmentBuilder.java b/hsweb-easy-orm-rdb/src/main/java/org/hswebframework/ezorm/rdb/operator/builder/fragments/term/EnumInFragmentBuilder.java index 481db77a..f668e6db 100644 --- a/hsweb-easy-orm-rdb/src/main/java/org/hswebframework/ezorm/rdb/operator/builder/fragments/term/EnumInFragmentBuilder.java +++ b/hsweb-easy-orm-rdb/src/main/java/org/hswebframework/ezorm/rdb/operator/builder/fragments/term/EnumInFragmentBuilder.java @@ -72,4 +72,21 @@ public static EnumInFragmentBuilder of(Dialect dialect) { throw new UnsupportedOperationException("unsupported db type :" + dialect.getType()); } + + public static EnumInFragmentBuilder ofNot(Dialect dialect) { + if (dialect instanceof MysqlDialect) { + return MysqlEnumInFragmentBuilder.notIn; + } + if (dialect instanceof PostgresqlDialect) { + return PostgresqlEnumInFragmentBuilder.notIn; + } + if (dialect instanceof SqlServerDialect) { + return SqlServerEnumInFragmentBuilder.notIn; + } + if (dialect instanceof OracleDialect) { + return OracleEnumInFragmentBuilder.notIn; + } + + throw new UnsupportedOperationException("unsupported db type :" + dialect.getType()); + } }