Skip to content

Commit

Permalink
Added case showing parameterized mapped superclass issue
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmsilva committed Feb 11, 2025
1 parent bd7767c commit c2f2467
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.querydsl.examples.kotlin.entity

import jakarta.persistence.GeneratedValue
import jakarta.persistence.GenerationType
import jakarta.persistence.Id
import jakarta.persistence.MappedSuperclass
import java.io.Serializable

@MappedSuperclass
abstract class ExampleBaseEntity<ID : Serializable> {

@field:Id
@field:GeneratedValue(strategy = GenerationType.AUTO)
var id: ID? = null
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ import jakarta.persistence.*

@Entity
data class ExampleEntity(
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
val id: Int,

@Column
val name: String,

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

0 comments on commit c2f2467

Please sign in to comment.