org.apereo.cas.nativex.JdbcDriversRuntimeHints Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of cas-server-support-jdbc-drivers Show documentation
Show all versions of cas-server-support-jdbc-drivers Show documentation
cas-server-support-jdbc-drivers
The newest version!
package org.apereo.cas.nativex;
import org.apereo.cas.util.nativex.CasRuntimeHintsRegistrar;
import org.springframework.aot.hint.RuntimeHints;
import org.springframework.aot.hint.TypeReference;
import javax.sql.DataSource;
import java.sql.Driver;
import java.util.List;
/**
* This is {@link JdbcDriversRuntimeHints}.
*
* @author Misagh Moayyed
* @since 7.0.0
*/
public class JdbcDriversRuntimeHints implements CasRuntimeHintsRegistrar {
@Override
public void registerHints(final RuntimeHints hints, final ClassLoader classLoader) {
registerReflectionHints(hints, findSubclassesInPackage(Driver.class,
"com.mysql", "net.sourceforge", "org.h2",
"org.mariadb", "org.postgresql", "org.apache.ignite",
"org.sqlite", "org.hsqldb", "oracle.jdbc", "com.microsoft"));
registerReflectionHints(hints, List.of(
TypeReference.of("oracle.jdbc.logging.annotations.Feature"),
TypeReference.of("org.hsqldb.dbinfo.DatabaseInformationFull"),
TypeReference.of("org.hsqldb.dbinfo.DatabaseInformation")
));
hints.resources()
.registerResourceBundle("org/hsqldb/resources/sql-state-messages")
.registerPattern("org/hsqldb/resources/*.sql")
.registerPattern("org/hsqldb/resources/*.properties");
registerReflectionHints(hints, List.of(DataSource.class));
}
}