org.babyfish.jimmer.spring.cfg.SqlClientInitializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jimmer-spring-boot-starter Show documentation
Show all versions of jimmer-spring-boot-starter Show documentation
A revolutionary ORM framework for both java and kotlin
package org.babyfish.jimmer.spring.cfg;
import org.babyfish.jimmer.sql.JSqlClient;
import org.babyfish.jimmer.sql.kt.KSqlClient;
import org.babyfish.jimmer.sql.kt.impl.KSqlClientImplementor;
import org.babyfish.jimmer.sql.runtime.JSqlClientImplementor;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import java.util.List;
public class SqlClientInitializer implements ApplicationRunner {
private final List javaSqlClients;
private final List kotlinSqlClients;
public SqlClientInitializer(List javaSqlClients, List kotlinSqlClients) {
this.javaSqlClients = javaSqlClients;
this.kotlinSqlClients = kotlinSqlClients;
}
@Override
public void run(ApplicationArguments args) throws Exception {
for (JSqlClient sqlClient : javaSqlClients) {
((JSqlClientImplementor) sqlClient).initialize();
}
for (KSqlClient sqlClient : kotlinSqlClients) {
((KSqlClientImplementor) sqlClient).initialize();
}
}
}