[IE Validation] - Erro ao ler estado

15 views
Skip to first unread message

Alan Cordeiro

unread,
Jul 5, 2017, 11:14:19 AM7/5/17
to Caelum Stella User
Boa tarde,

Conheci hoje o projeto Stella e estou tentando fazer uso da validação de IE. O meu cenário é o serguinte:

@IE(ieField="inscricaoEstadual")
@Entity
public class ClienteBase extends Cadastro implements Serializable {

    @Column(name = "cli_inscricao_estadual", length = 20)
    private String inscricaoEstadual;

    @Transient
    private String estado;

    public String getInscricaoEstadual() {
        return inscricaoEstadual;
    }

    public void setInscricaoEstadual(String inscricaoEstadual) {
        this.inscricaoEstadual = inscricaoEstadual;
    }

   public void setEstado(String estado) {
        this.estado = estado;
    }

    public String getEstado() {
        return estado;
    }

}

Quando eu tento salvar essa entidade, me é retornado o Erro: javax.validation.ValidationException: HV000028: Unexpected exception during isValid call.

Stack Trace do erro: https://hastebin.com/woyupixiju.sql


Onde estou errando?

Agradecido
Eu estado está sendo populado com a sigla do estado "MA", "SP" ...

Mario Amaral

unread,
Jul 5, 2017, 1:24:57 PM7/5/17
to caelum-st...@googlegroups.com

Parece que tem alguma coisa nula ai, tem um NPE na stack. Confere se estão chegando todos os valores.


--
You received this message because you are subscribed to the Google Groups "Caelum Stella User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caelum-stella-u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Alan Cordeiro

unread,
Jul 5, 2017, 1:30:53 PM7/5/17
to Caelum Stella User
Estranho,

Parece que é o próprio estado, mas eu consigo printar estado. Meu sysout antes do método salvar retorna:
Estado em clienteBase: AM
To unsubscribe from this group and stop receiving emails from it, send an email to caelum-stella-user+unsub...@googlegroups.com.

Alan Cordeiro

unread,
Jul 5, 2017, 1:47:16 PM7/5/17
to Caelum Stella User
Obrigado Mario,

Descobri o erro aqui. Ele não funciona se o atributo for transiente.
Reply all
Reply to author
Forward
0 new messages