I have two entities
data class MetaConfigEo(
@Id
val id: String? = null,
val config: Config,
)
data class ConfigEo(
@Id
val id: String? = null,
val config: Config,
@Enumerated(EnumType.STRING)
var configType: ConfigType,
@OneToOne
@JoinColumn(name = "meta_config_id")
var metaConfig: MetaConfigEo? = null,
)
And I have the following Jpa Repository
@Repository
interface MetaConfigRepository : JpaRepository<MetaConfigEo, String> {
@Query(
"SELECT mc FROM meta_config mc JOIN config c ON mc.id = c.metaConfig.id " +
"WHERE c.configType = :configType"
)
fun findMetaConfigByConfigType(configType: ConfigType): MetaConfigEo?
Is it possible to replace the given mthod in the JPA repository with a query which works with the name instead of specifying a JPQL Query in @Query?