Merge pull request 'melhoria enum' (#21) from melhoria_enums into master

Reviewed-on: http://18.235.188.113:3000/adm/ModelWeb/pulls/21
Reviewed-by: Valdir Cordeiro <valdir.cordeiro@totvs.com.br>
Reviewed-by: fabio <fabio.faria@rjconsultores.com.br>
master
Valdir Cordeiro 2023-01-16 12:03:21 +00:00
commit a45655a32c
2 changed files with 6 additions and 2 deletions

View File

@ -61,7 +61,11 @@ public class CustomEnumTypeHibernate implements UserType, ParameterizedType {
@Override
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

View File

@ -105,7 +105,7 @@ public class TipoEventoExtra implements Serializable {
@Type(type = "com.rjconsultores.ventaboletos.constantes.CustomEnumTypeHibernate", parameters = {
@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")
private com.rjconsultores.ventaboletos.constantes.TipoEventoExtra cvetipoevento;