I have class
class DateOptTimeType implements org.hibernate.usertype.UserType
that works with two columns
@org.hibernate.annotations.Type(type = "com.mmyPack.DateOptTimeType")
@org.hibernate.annotations.Columns(columns = {
@javax.persistence.Column(name = "DATE1"),
@javax.persistence.Column(name = "FLAG")
}) protected DateOptTime dateOfDeath;
Can i do, that class will work with 1 column too (with 1 column and with two columns), like
@javax.persistence.Column(name = "DATE1"),
protected DateOptTime dateOfDeath;
You need 2 UserTypes because the UserType returns the number of needed columns in getSqlTypes()
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