Pessoal, estou tentando fazer a seguinte rotina:
Quando eu retorno para a a pagina , da o erro abaixo :
Error reading ‘ld’ on type br.com.cqa.lims.web.orcamento.helper.AnaliseItem
- O interessante que esta caindo sempre no ELSE do if
Analise analisevw = new Analise();
analisevw.setId(vwanalise.getId());
if (StringUtil.isEmpty(vwanalise.getLd())) {
analisevw.setLd(null);
} else {
analisevw.setLd(new I18NBigDecimal(vwanalise.getLd()));
}
****************************************************************************
page
<rich:column>
<h:outputText value="#{analise.ld}" />
</rich:column>
*******************************************************************************
classe Analise
****Id esta na extends da entidade
public class Analise extends Entidade {
private static final long serialVersionUID = 6480444403107299057L;
@OneToOne
private Ensaio ensaio;
@OneToOne
private Metodo metodo;
@OneToOne
private Matriz matriz;
@OneToOne(optional = true)
private Unidade unidadePadrao;
private String ld;
private String lq;
@Embedded
private Dinheiro preco = new Dinheiro();
private int prazo;
private String sufixoUnidade;
/**
* Analise so pode ser executada por um departamento
*/
@ManyToOne
private Departamento departamento;
/**
* Define que essa analise eh a padrao para esta matriz
*/
private boolean padrao;
public Analise() {
super();
}
public Analise(Analise analise) {
this.ensaio = analise.getEnsaio();
this.metodo = analise.getMetodo();
this.matriz = analise.getMatriz();
this.unidadePadrao = analise.getUnidadePadrao();
this.ld = analise.getLd().toString();
this.lq = analise.getLq().toString();
this.preco = analise.getPreco();
this.prazo = analise.getPrazo();
this.id = analise.getId();
}
public Dinheiro getPreco() {
return preco;
}
public void setPreco(Dinheiro preco) {
this.preco = preco;
}
public int getPrazo() {
return prazo;
}
public void setPrazo(int prazo) {
this.prazo = prazo;
}
@NotNull
public Ensaio getEnsaio() {
return ensaio;
}
public void setEnsaio(Ensaio ensaio) {
this.ensaio = ensaio;
}
@NotNull
public Metodo getMetodo() {
return metodo;
}
public void setMetodo(Metodo metodo) {
this.metodo = metodo;
}
public Matriz getMatriz() {
return matriz;
}
public void setMatriz(Matriz matriz) {
this.matriz = matriz;
}
public Unidade getUnidadePadrao() {
return unidadePadrao;
}
public void setUnidadePadrao(Unidade unidadePadrao) {
this.unidadePadrao = unidadePadrao;
}
public I18NBigDecimal getLd() {
if (ld != null) {
return new I18NBigDecimal(ld);
}
return null;
}
public void setLd(I18NBigDecimal ld) {
this.ld = (ld != null) ? ld.toString() : null;
}
public I18NBigDecimal getLq() {
if (lq != null) {
return new I18NBigDecimal(lq);
}
return null;
}
public void setLq(I18NBigDecimal lq) {
this.lq = (lq != null) ? lq.toString() : null;
}
public boolean isPadrao() {
return padrao;
}
public void setPadrao(boolean padrao) {
this.padrao = padrao;
}
public Departamento getDepartamento() {
return this.departamento;
}
public void setDepartamento(Departamento departamento) {
this.departamento = departamento;
}
public String getSufixoUnidade() {
return sufixoUnidade;
}
public void setSufixoUnidade(String sufixoUnidade) {
this.sufixoUnidade = sufixoUnidade;
}
@Override
public int hashCode() {
final int prime = 31;
int result = super.hashCode();
result = prime * result + ((id == null) ? 0 : id.hashCode());
result = prime * result + ((ensaio == null) ? 0 : ensaio.hashCode());
result = prime * result + ((matriz == null) ? 0 : matriz.hashCode());
result = prime * result + ((metodo == null) ? 0 : metodo.hashCode());
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (!super.equals(obj))
return false;
if (getClass() != obj.getClass())
return false;
Analise other = (Analise) obj;
if (id != null && other.id != null) {
return id.equals(other.id);
} else {
if (ensaio == null) {
if (other.ensaio != null)
return false;
} else if (!ensaio.equals(other.ensaio))
return false;
if (matriz == null) {
if (other.matriz != null)
return false;
} else if (!matriz.equals(other.matriz))
return false;
if (metodo == null) {
if (other.metodo != null)
return false;
} else if (!metodo.equals(other.metodo))
return false;
return true;
}
}
}