Describe the bug
When @EmbeddedId is declared as an inner class of a JPA entity,
ksp-codegen generates an unqualified type reference that fails to compile.
To Reproduce
Add a JPA entity with an @EmbeddedId declared as an inner class:
@Entity
class Invoice(
@EmbeddedId val id: InvoiceId
) {
@Embeddable
data class InvoiceId(
val invoiceNo: String = "",
val seq: Int = 0
) : Serializable
}
Running kspKotlin generates QInvoice_InvoiceId.kt with an unqualified type reference that fails to compile.
Generated (wrong)
BeanPath<InvoiceId> // cannot be resolved
Expected
BeanPath<Invoice.InvoiceId> // correct qualified reference
Root cause
QueryModelExtractor.toQueryModel() builds originalClassName using only classDeclaration.simpleName, which drops the enclosing class from the generated type reference.
Describe the bug
When @EmbeddedId is declared as an inner class of a JPA entity,
ksp-codegen generates an unqualified type reference that fails to compile.
To Reproduce
Add a JPA entity with an
@EmbeddedIddeclared as an inner class:Running
kspKotlingeneratesQInvoice_InvoiceId.ktwith an unqualified type reference that fails to compile.Generated (wrong)
Expected
Root cause
QueryModelExtractor.toQueryModel()buildsoriginalClassNameusing onlyclassDeclaration.simpleName, which drops the enclosing class from the generated type reference.