forked from quarkusio/quarkus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: register proxies to make Mysql HA work in native
Fix quarkusio#7936
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...dbc-mysql/deployment/src/main/java/io/quarkus/jdbc/mysql/deployment/MySQLJDBCProxies.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package io.quarkus.jdbc.mysql.deployment; | ||
|
||
import java.io.Serializable; | ||
import java.sql.Statement; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import com.mysql.cj.MysqlConnection; | ||
import com.mysql.cj.conf.PropertySet; | ||
import com.mysql.cj.jdbc.JdbcConnection; | ||
import com.mysql.cj.jdbc.JdbcPreparedStatement; | ||
import com.mysql.cj.jdbc.JdbcPropertySet; | ||
import com.mysql.cj.jdbc.JdbcStatement; | ||
import com.mysql.cj.jdbc.ha.LoadBalancedConnection; | ||
import com.mysql.cj.jdbc.ha.ReplicationConnection; | ||
import com.mysql.cj.jdbc.result.ResultSetInternalMethods; | ||
import com.mysql.cj.protocol.Resultset; | ||
|
||
import io.quarkus.deployment.annotations.BuildStep; | ||
import io.quarkus.deployment.builditem.nativeimage.NativeImageProxyDefinitionBuildItem; | ||
|
||
public final class MySQLJDBCProxies { | ||
|
||
@BuildStep | ||
List<NativeImageProxyDefinitionBuildItem> registerProxies() { | ||
List<NativeImageProxyDefinitionBuildItem> proxies = new ArrayList<>(); | ||
proxies.add(new NativeImageProxyDefinitionBuildItem(JdbcConnection.class.getName())); | ||
proxies.add(new NativeImageProxyDefinitionBuildItem(MysqlConnection.class.getName())); | ||
proxies.add(new NativeImageProxyDefinitionBuildItem(Statement.class.getName())); | ||
proxies.add(new NativeImageProxyDefinitionBuildItem(AutoCloseable.class.getName())); | ||
proxies.add(new NativeImageProxyDefinitionBuildItem(JdbcStatement.class.getName())); | ||
proxies.add( | ||
new NativeImageProxyDefinitionBuildItem(JdbcPreparedStatement.class.getName(), JdbcStatement.class.getName())); | ||
proxies.add(new NativeImageProxyDefinitionBuildItem(JdbcPropertySet.class.getName(), PropertySet.class.getName(), | ||
Serializable.class.getName())); | ||
proxies.add( | ||
new NativeImageProxyDefinitionBuildItem(Resultset.class.getName(), ResultSetInternalMethods.class.getName())); | ||
proxies.add(new NativeImageProxyDefinitionBuildItem(LoadBalancedConnection.class.getName(), | ||
JdbcConnection.class.getName())); | ||
proxies.add( | ||
new NativeImageProxyDefinitionBuildItem(ReplicationConnection.class.getName(), JdbcConnection.class.getName())); | ||
return proxies; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters