0
This field is filled in correctly by a query made in the DAO.
The problem is that you are not accepting the object as null or as the value by the ID.
The entity’s field is
Man Entity
@ManyToOne
@JoinColumn(name = "cos_id_id")
public CosifEntity getCosif() {
return cosif;
}
public void setCosif(CosifEntity cosif) {
this.cosif = cosif;
}
I have this eclipse log error.
Field error in object 'cosifEntity' on field 'cosif': rejected value []; codes [typeMismatch.cosifEntity.cosif,typeMismatch.cosif,typeMismatch.br.com.netsoft.desif.model.desif.federal.CosifEntity,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [cosifEntity.cosif,cosif]; arguments []; default message [cosif]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'br.com.netsoft.desif.model.desif.federal.CosifEntity' for property 'cosif'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [br.com.netsoft.desif.model.desif.federal.CosifEntity] for property 'cosif': no matching editors or conversion strategy found]
jsp looks like this for this field:
Man jsp
<select class="chosen-select form-control" id="cosif" name="cosif" data-placeholder="Selecione uma COSIF">
<option value=""></option>
<c:forEach var="contaSuperior" items="${listaContaSuperior}">
<option value="${contaSuperior.id}">
${contaSuperior.numeroNome}</option>
</c:forEach>
</select>
What can it be ?
How to convert the chosen record to the class before persisting.
– Guilherme