Firebird JPA returning null values

Asked

Viewed 69 times

0

When I try to get some record from the bank, some fields come null, although in the table they are not null!

Any idea what might be causing this behavior?

I’m using Java 8, Hibernate 5.2.4, Jaybird 3.0.3.

So I’m getting Pessoa’s data:

Pessoa p = manager.find(Pessoa.class, 20829);

My PU is like this:

<property name="javax.persistence.jdbc.url" value="jdbc:firebirdsql://192.168.56.101:3050/questorteste?encoding=ISO8859_1" />  
<property name="javax.persistence.jdbc.user" value="SYSDBA" />  
<property name="javax.persistence.jdbc.password" value="masterkey" />  
<property name="javax.persistence.jdbc.driver" value="org.firebirdsql.jdbc.FBDriver" />  

My Entitymanagerproducer

public class EntityManagerProducer {
  private EntityManagerFactory factory;

  public EntityManagerProducer() {
    factory = Persistence.createEntityManagerFactory("Firebird");
  }

  public EntityManager createEntityManager() {
    return factory.createEntityManager();
  }
}

Entidade Pessoa

    @Entity
    public class Pessoa implements Serializable {

    private static final long serialVersionUID = -2991232997484581117L;

    @Id
    @Column(name = "codigopessoa")
    private Integer codigopessoa;

    @Column(name = "NOMEPESSOA")
    private String nomepessoa;

    @Column(name = "TIPOINSCR")
    private Short tipoinscr;

    @Column(name = "INSCRFEDERAL")
    private String inscrfederal;

    @Column(name = "SUFRAMA")
    private String suframa;

    @Column(name = "SIGLAESTADO")
    private String siglaestado;

    @Column(name = "CODIGOMUNIC")
    private Short codigomunic;

    @Column(name = "tipofornecedor")
    private Short tipofornecedor;

    @Column(name = "INSCRESTAD")
    private String inscrestad;

    @Column(name = "INSCRMUNIC")
    private String inscrmunic;

    @Column(name = "CODIGOATIVFEDERAL")
    private String codigoativfederal;

    public Pessoa() {
    }

    public Integer getCodigopessoa() {
        return this.codigopessoa;
    }

    public void setCodigopessoa(Integer codigopessoa) {
        System.out.println("setCodigopessoa");
        this.codigopessoa = codigopessoa;
    }

    public String getNomepessoa() {
        return this.nomepessoa;
    }

    public void setNomepessoa(String nomepessoa) {
        System.out.println("setNomepessoa");
        this.nomepessoa = nomepessoa;
    }

    public Short getTipoinscr() {
        return this.tipoinscr;
    }

    public void setTipoinscr(Short tipoinscr) {
        System.out.println("setTipoinscr");
        this.tipoinscr = tipoinscr;
    }

    public String getInscrfederal() {
        return this.inscrfederal;
    }

    public void setInscrfederal(String inscrfederal) {
        System.out.println("setInscrfederal");
        this.inscrfederal = inscrfederal;
    }

    public String getSuframa() {
        return this.suframa;
    }

    public void setSuframa(String suframa) {
        System.out.println("setSuframa");
        this.suframa = suframa;
    }

    public String getSiglaestado() {
        return this.siglaestado;
    }

    public void setSiglaestado(String siglaestado) {
        System.out.println("setSiglaestado");
        this.siglaestado = siglaestado;
    }

    public Short getCodigomunic() {
        return this.codigomunic;
    }

    public void setCodigomunic(Short codigomunic) {
        System.out.println("setCodigomunic");
        this.codigomunic = codigomunic;
    }

    public Short getTipofornecedor() {
        return this.tipofornecedor;
    }

    public void setTipofornecedor(Short tipofornecedor) {
        System.out.println("setTipofornecedor");
        this.tipofornecedor = 2;
    }

    public String getInscrestad() {
        return this.inscrestad;
    }

    public void setInscrestad(String inscrestad) {
        System.out.println("setInscrestad");
        this.inscrestad = inscrestad;
    }

    public String getInscrmunic() {
        return this.inscrmunic;
    }

    public void setInscrmunic(String inscrmunic) {
        System.out.println("setInscrmunic");
        this.inscrmunic = inscrmunic;
    }

    public String getCodigoativfederal() {
        return this.codigoativfederal;
    }

    public void setCodigoativfederal(String codigoativfederal) {
        System.out.println("setCodigoativfederal");
        this.codigoativfederal = codigoativfederal;
    }
}

1 answer

0

I found the problem. I was in my connection string, I leaned to a bench and compared to another... I sucked bullet...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.