Skip to content

Commit

Permalink
feat: add hibernate dialects for mysql if user has not set by default (
Browse files Browse the repository at this point in the history
…#161)

Signed-off-by: Sarthak160 <rocksarthak45@gmail.com>
  • Loading branch information
Sarthak160 authored Dec 6, 2023
1 parent d9e5be5 commit f9225f2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public static void enterMethod(@Advice.Origin Method method, @Advice.Argument(va
KDriver.Dialect = "org.hibernate.dialect.PostgreSQLDialect";
break;
case "com.mysql.cj.jdbc.Driver":
case "com.mysql.jdbc.Driver":
KDriver.Dialect = "org.hibernate.dialect.MySQLDialect";
break;
case "oracle.jdbc.driver.OracleDriver":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public static String execute(@SuperCall Callable<String> client, @Origin Method
KDriver.Dialect = "org.hibernate.dialect.PostgreSQLDialect";
break;
case "com.mysql.cj.jdbc.Driver":
case "com.mysql.jdbc.Driver":
KDriver.Dialect = "org.hibernate.dialect.MySQLDialect";
break;
case "oracle.jdbc.driver.OracleDriver":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ public String getDatabaseProductName() throws SQLException {
case "org.postgresql.Driver":
return "PostgreSQL";
case "com.mysql.cj.jdbc.Driver":
case "com.mysql.jdbc.Driver":
return "MySQL";
case "org.h2.Driver":
return "H2";
Expand Down

0 comments on commit f9225f2

Please sign in to comment.