Closed ezlearning closed 1 year ago
So does it work in JVM mode? And I think you can try to add @RegisterForReflection(target = "org.mybatis.dynamic.sql.util.SqlProviderAdapter")
to if it can resolve the native building error.
thank you very much, it worked.
import io.quarkus.runtime.annotations.RegisterForReflection
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Param
import org.apache.ibatis.annotations.Select
import org.mybatis.dynamic.sql.util.mybatis3.CommonCountMapper
import org.mybatis.dynamic.sql.util.mybatis3.CommonDeleteMapper
import org.mybatis.dynamic.sql.util.mybatis3.CommonInsertMapper
import org.mybatis.dynamic.sql.util.mybatis3.CommonUpdateMapper
import org.apache.ibatis.annotations.SelectProvider
import org.apache.ibatis.annotations.Result
import org.apache.ibatis.annotations.ResultMap
import org.apache.ibatis.annotations.Results
import org.apache.ibatis.type.JdbcType
import org.mybatis.dynamic.sql.select.render.DefaultSelectStatementProvider
import org.mybatis.dynamic.sql.util.SqlProviderAdapter
import org.mybatis.dynamic.sql.select.render.SelectStatementProvider
@Mapper
@RegisterForReflection( targets = [SqlProviderAdapter::class, DefaultSelectStatementProvider::class])
interface CtStoreMapper : CommonCountMapper, CommonDeleteMapper, CommonInsertMapper<CtStore>, CommonUpdateMapper {
@SelectProvider(type = SqlProviderAdapter::class, method = "select")
@Results(id="CtStoreResult", value = [
Result(column="store_no", property="storeNo", jdbcType=JdbcType.VARCHAR),
Result(column="store_sn", property="storeSn", jdbcType=JdbcType.VARCHAR),
])
fun selectMany(selectStatement: SelectStatementProvider): List<CtStore>
@SelectProvider(type = SqlProviderAdapter::class, method = "select")
@ResultMap("CtStoreResult")
fun selectOne(selectStatement: SelectStatementProvider): CtStore?
@Select("SELECT store_sn, store_no FROM ct_store WHERE store_sn = #{storeSn}")
fun getStore(@Param("storeSn") storeSn: String): CtStore?
@Select("SELECT store_sn, store_no FROM ct_store")
fun getStoreList(): List<CtStore>
}
please support org.mybatis.dynamic-sql:mybatis-dynamic-sql:1.5.0.
currently, in native build, i got this exception:
Mapper