Ir ao conteúdo
  • Cadastre-se

SessionFactory...org.hibernate.AnnotationException


Posts recomendados

Ao tentar executar o BancoDAOTest.java no JUnit, aparece a seguinte mensagem:

Falha ao tentar criar o SessionFactory...org.hibernate.AnnotationException: @Temporal should only be set on a java.util.Date or java.util.Calendar property: com.serginho.domain.NotaCupomFiscal.hr_saida

package com.serginho.domain;import java.math.BigDecimal;import java.sql.Time;import java.util.Date;import javax.persistence.Column;import javax.persistence.Entity;import javax.persistence.FetchType;import javax.persistence.GeneratedValue;import javax.persistence.GenerationType;import javax.persistence.Id;import javax.persistence.JoinColumn;import javax.persistence.ManyToOne;import javax.persistence.Table;import javax.persistence.Temporal;import javax.persistence.TemporalType;@Entity@Table(name="nota_cupom_fiscal")public class NotaCupomFiscal {	@Id	@GeneratedValue(strategy = GenerationType.AUTO)	@Column(name = "id")	private Long id;		@Column(name = "num_nota_cupom_fiscal")	private Long num_nota_cupom_fiscal;		@[member=Temporal](value = TemporalType.DATE)	@Column(name = "dt_emissao")	private Date dt_emissao;		@[member=Temporal](value = TemporalType.DATE)	@Column(name = "dt_saida")	private Date dt_saida;		@[member=Temporal](value = TemporalType.TIME)	@Column(name = "hr_saida")	private Time hr_saida;		@Column(name = "tot_nota_cupom_fiscal", precision = 12, scale = 2, nullable = false)	private BigDecimal tot_nota_cupom_fiscal;		@Column(name = "vlr_cheque_doc_ted", precision = 12, scale = 2, nullable = false)	private BigDecimal vlr_cheque_doc_ted;		@ManyToOne(fetch = FetchType.EAGER)	@JoinColumn(name = "pessoa_id", referencedColumnName = "id")	private Pessoa pessoa;	/**	 * @[member=Return] the id	 */	public Long getId() {		return id;	}	/**	 * @param id the id to set	 */	public void setId(Long id) {		this.id = id;	}	/**	 * @[member=Return] the num_nota_cupom_fiscal	 */	public Long getNum_nota_cupom_fiscal() {		return num_nota_cupom_fiscal;	}	/**	 * @param num_nota_cupom_fiscal the num_nota_cupom_fiscal to set	 */	public void setNum_nota_cupom_fiscal(Long num_nota_cupom_fiscal) {		this.num_nota_cupom_fiscal = num_nota_cupom_fiscal;	}	/**	 * @[member=Return] the dt_emissao	 */	public Date getDt_emissao() {		return dt_emissao;	}	/**	 * @param dt_emissao the dt_emissao to set	 */	public void setDt_emissao(Date dt_emissao) {		this.dt_emissao = dt_emissao;	}	/**	 * @[member=Return] the dt_saida	 */	public Date getDt_saida() {		return dt_saida;	}	/**	 * @param dt_saida the dt_saida to set	 */	public void setDt_saida(Date dt_saida) {		this.dt_saida = dt_saida;	}	/**	 * @[member=Return] the hr_saida	 */	public Time getHr_saida() {		return hr_saida;	}	/**	 * @param hr_saida the hr_saida to set	 */	public void setHr_saida(Time hr_saida) {		this.hr_saida = hr_saida;	}	/**	 * @[member=Return] the tot_nota_cupom_fiscal	 */	public BigDecimal getTot_nota_cupom_fiscal() {		return tot_nota_cupom_fiscal;	}	/**	 * @param tot_nota_cupom_fiscal the tot_nota_cupom_fiscal to set	 */	public void setTot_nota_cupom_fiscal(BigDecimal tot_nota_cupom_fiscal) {		this.tot_nota_cupom_fiscal = tot_nota_cupom_fiscal;	}	/**	 * @[member=Return] the vlr_cheque_doc_ted	 */	public BigDecimal getVlr_cheque_doc_ted() {		return vlr_cheque_doc_ted;	}	/**	 * @param vlr_cheque_doc_ted the vlr_cheque_doc_ted to set	 */	public void setVlr_cheque_doc_ted(BigDecimal vlr_cheque_doc_ted) {		this.vlr_cheque_doc_ted = vlr_cheque_doc_ted;	}	/**	 * @[member=Return] the pessoa	 */	public Pessoa getPessoa() {		return pessoa;	}	/**	 * @param pessoa the pessoa to set	 */	public void setPessoa(Pessoa pessoa) {		this.pessoa = pessoa;	}}
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novas respostas.

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...