Bom dia a todos, por favor pessoal to com uma duvida no hibernate que eh o seguinte, segue o codigo:
import javax.*;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Transient;
import org.hibernate.annotations.Entity;
import org.hibernate.annotations.Table;
@Entity
@Table(name="tb_cliente") //AQUI O ERRO
public class Cliente {
@Id
@Column(name="cpf")
private String cpf;
@Column(name = "nome")
private String nome;
@Transient
private Endereco endereco;
public Cliente(String newCpf, String newNome) {
this.cpf = newCpf;
this.nome = newNome;
this.endereco = null;
}
public Cliente(String newCpf, String newNome, Endereco endereco) {
this.cpf = newCpf;
this.nome = newNome;
this.endereco = endereco;
}
public String getCpf() {
return cpf;
}
public String getNome() {
return nome;
}
public Endereco getEndereco() {
return endereco;
}
public void setCpf(String newCpf) {
cpf = newCpf;
}
public void setNome(String newNome) {
nome = newNome;
}
public void setEndereco(Endereco endereco) {
this.endereco = endereco;
}
}
O erro q aparece na minha @Table(name=“tb_cliente”)
- The annotation @Table must define the attribute appliesTo
- The attribute name is undefined for the annotation type Table
e nao sei como resolver isso.
Agradeço demais pela ajuda de todos, forte abraço!!!