io.micronaut.starter.cli.feature.database.groovyRepository.rocker.raw Maven / Gradle / Ivy
@import io.micronaut.starter.application.Project
@args (
Project project,
String idTypeImport,
String idType,
Boolean jdbcRepository,
String dialect
)
@if (project.getPackageName() != null) {
package @project.getPackageName()
}
import io.micronaut.data.annotation.*
import io.micronaut.data.model.*
import io.micronaut.data.repository.CrudRepository
@if (idTypeImport != null) {
@idTypeImport
}
@if (jdbcRepository) {
import io.micronaut.data.jdbc.annotation.JdbcRepository
import io.micronaut.data.model.query.builder.sql.Dialect
}
@if (jdbcRepository) {
@if (dialect != null) {
@@JdbcRepository(dialect = Dialect.@dialect)
} else {
@@JdbcRepository
}
} else {
@@Repository
}
interface @project.getClassName()Repository extends CrudRepository<@project.getClassName(), @idType> {
}