Hello, I have the following method:
@RequestMapping(value = "/pesquisa", method = RequestMethod.POST)
public String pesquisa(@ModelAttribute("relSintetico") @Valid RelSintetico relSintetico, BindingResult bindingResult) {
Timestamp dataInicial = relSintetico.getDataInicial();
Timestamp dataFinal = relSintetico.getDataFinal();
System.out.println("Pesquisando");
System.out.println(dataInicial);
List<VE_RelResumoArrecadacao> relatorio = repositorioSintetico.findByDataOperacao(dataInicial, dataFinal);
System.out.println("Pesquisado!");
System.out.println(relatorio.size());
return "sintetico.relatorios.tiles";
}
This method takes the relational modelAtribute from the page below:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
Synthetic Report
This is the class RelSynthetic Model:
package br.com.apasi.spring.dominios;
import java.io.Serializable; import java.sql.Timestamp;
import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; import javax.persistence.Table;
@Entity @Table (name="RelSintetico", catalog="Pedagio", schema="dbo") public class RelSintetico implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@Column(name = "IdRelSintetico")
private Integer idRelSintetico;
@Column(name = "DataInicial")
private Timestamp dataInicial;
@Column(name = "DataFinal")
private Timestamp dataFinal;
public Integer getIdRelSintetico() {
return idRelSintetico;
}
public void setIdRelSintetico(Integer idRelSintetico) {
this.idRelSintetico = idRelSintetico;
}
public Timestamp getDataInicial() {
return dataInicial;
}
public Timestamp getDataFinal() {
return dataFinal;
}
public void setDataInicial(Timestamp dataInicial) {
this.dataInicial = dataInicial;
}
public void setDataFinal(Timestamp dataFinal) {
this.dataFinal = dataFinal;
}
}
But the method returns null for getDataInitial and getDataFinal ... Is there anything to do with date conversion? or am I getting this Model data wrong?