Skip to content

Commit bfc4ea2

Browse files
committed
Added case showing parameterized mapped superclass issue
1 parent 0e99543 commit bfc4ea2

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.querydsl.examples.kotlin.entity
2+
3+
import jakarta.persistence.GeneratedValue
4+
import jakarta.persistence.GenerationType
5+
import jakarta.persistence.Id
6+
import jakarta.persistence.MappedSuperclass
7+
import java.io.Serializable
8+
9+
@MappedSuperclass
10+
abstract class ExampleBaseEntity<ID : Serializable> {
11+
12+
@field:Id
13+
@field:GeneratedValue(strategy = GenerationType.AUTO)
14+
var id: ID? = null
15+
}

querydsl-examples/querydsl-example-kotlin-codegen/src/main/kotlin/com/querydsl/examples/kotlin/entity/ExampleEntity.kt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ import jakarta.persistence.*
2020

2121
@Entity
2222
data class ExampleEntity(
23-
@Id
24-
@GeneratedValue(strategy = GenerationType.AUTO)
25-
val id: Int,
26-
2723
@Column
2824
val name: String,
2925

@@ -36,5 +32,5 @@ data class ExampleEntity(
3632
@Convert(converter = MapConverter::class)
3733
@Column(columnDefinition = "jsonb")
3834
val metadata: Map<String, Any> = mutableMapOf(),
39-
) {
35+
) : ExampleBaseEntity<Int>() {
4036
}

0 commit comments

Comments
 (0)