mirror of
https://github.com/jlengrand/Exposed.git
synced 2026-03-10 08:11:20 +00:00
Can't load implementation for DatabaseConnectionAutoRegistration #748
This commit is contained in:
@@ -11,7 +11,7 @@ interface EntityIDFactory {
|
||||
object EntityIDFunctionProvider {
|
||||
private val factory : EntityIDFactory
|
||||
init {
|
||||
factory = ServiceLoader.load(EntityIDFactory::class.java).firstOrNull()
|
||||
factory = ServiceLoader.load(EntityIDFactory::class.java, EntityIDFactory::class.java.classLoader).firstOrNull()
|
||||
?: object : EntityIDFactory {
|
||||
override fun <T : Comparable<T>> createEntityID(value: T, table: IdTable<T>): EntityID<T> {
|
||||
return EntityID(value, table)
|
||||
|
||||
@@ -61,7 +61,7 @@ class Database private constructor(val connector: () -> ExposedConnection<*>) {
|
||||
private val dialects = ConcurrentHashMap<String, () -> DatabaseDialect>()
|
||||
|
||||
private val connectionInstanceImpl : DatabaseConnectionAutoRegistration =
|
||||
ServiceLoader.load(DatabaseConnectionAutoRegistration::class.java).firstOrNull() ?: error("Can't load implementation for ${DatabaseConnectionAutoRegistration::class.simpleName}")
|
||||
ServiceLoader.load(DatabaseConnectionAutoRegistration::class.java, Database::class.java.classLoader).firstOrNull() ?: error("Can't load implementation for ${DatabaseConnectionAutoRegistration::class.simpleName}")
|
||||
|
||||
init {
|
||||
registerDialect(H2Dialect.dialectName) { H2Dialect() }
|
||||
|
||||
@@ -177,7 +177,7 @@ open class Transaction(private val transactionImpl: TransactionInterface): UserD
|
||||
internal val globalInterceptors = arrayListOf<GlobalStatementInterceptor>()
|
||||
|
||||
init {
|
||||
ServiceLoader.load(GlobalStatementInterceptor::class.java).forEach {
|
||||
ServiceLoader.load(GlobalStatementInterceptor::class.java, GlobalStatementInterceptor::class.java.classLoader).forEach {
|
||||
globalInterceptors.add(it)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user