I have this Document
hibernate jpa entity with an EmbeddedId
:
@Entity
data class Document(
@EmbeddedId
@NotNull
val documentExpertId: DocumentExpertId,
// other fields
)
@Embeddable
data class DocumentExpertId(
@Column(nullable = false)
val expertId: String,
@Column(nullable = false)
val name: String
) : Serializable
To get all the documents by expertId
, I would like to have my document JPA repository interface method called:
fun findAllByExpertId(String expertId): List<Document>
But, the only way I found to do so is:
fun findAllByDocumentExpertIdExpertId(String expertId): List<Document>
Is there an other way to have a better name for this method?