What is the equivalent Kotlin code of this Java snippet?
@Data
@Entity
@TypeDefs({
@TypeDef(name = "string-array", typeClass = StringArrayType.class),
@TypeDef(name = "int-array", typeClass = IntArrayType.class),
@TypeDef(name = "json", typeClass = JsonStringType.class),
@TypeDef(name = "jsonb", typeClass = JsonBinaryType.class)
})
public class Parent implements Serializable {
//....
}
finally following code works.
@TypeDefs(
TypeDef(name = "string-array", typeClass = StringArrayType::class),
TypeDef(name = "int-array", typeClass = IntArrayType::class),
TypeDef(name = "json", typeClass = JsonStringType::class),
TypeDef(name = "jsonb", typeClass = JsonBinaryType::class)
)
Try this.
@Data
@Entity
@TypeDefs(
TypeDef(name = "string-array", typeClass = StringArrayType::class.java),
TypeDef(name = "int-array", typeClass = IntArrayType::class.java),
TypeDef(name = "json", typeClass = JsonStringType::class.java),
TypeDef(name = "jsonb", typeClass = JsonBinaryType::class.java))
class Parent : Serializable
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With