melhoria enum
parent
a96c794fa9
commit
fa976e7de4
|
@ -61,7 +61,11 @@ public class CustomEnumTypeHibernate implements UserType, ParameterizedType {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
|
public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
|
||||||
|
if (value == null) {
|
||||||
|
st.setNull(index, Types.VARCHAR);
|
||||||
|
} else {
|
||||||
|
st.setObject(index, value.toString(), Types.VARCHAR);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -105,7 +105,7 @@ public class TipoEventoExtra implements Serializable {
|
||||||
|
|
||||||
@Type(type = "com.rjconsultores.ventaboletos.constantes.CustomEnumTypeHibernate", parameters = {
|
@Type(type = "com.rjconsultores.ventaboletos.constantes.CustomEnumTypeHibernate", parameters = {
|
||||||
@Parameter(name = "type", value = "com.rjconsultores.ventaboletos.constantes.CustomEnumTypeHibernate"),
|
@Parameter(name = "type", value = "com.rjconsultores.ventaboletos.constantes.CustomEnumTypeHibernate"),
|
||||||
@Parameter(name = "class", value = "com.rjconsultores.ventaboletos.constantes.TipoEventoExtra.class"), })
|
@Parameter(name = "class", value = "com.rjconsultores.ventaboletos.constantes.TipoEventoExtra"), })
|
||||||
@Column(name = "CVETIPOEVENTO")
|
@Column(name = "CVETIPOEVENTO")
|
||||||
private com.rjconsultores.ventaboletos.constantes.TipoEventoExtra cvetipoevento;
|
private com.rjconsultores.ventaboletos.constantes.TipoEventoExtra cvetipoevento;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue