Olá, estou iniciando com hibernate, porém ainda sim tenho duvidas em algo do tipo:
Tenho as seguintes classes:
[code]import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name=“tb_tipoimoveis”)
public class TipoImovel {
@Id
@GeneratedValue
@Column(name="id")
private int id;
@Column(name="txtNome", length=32, nullable=true)
private String txtNome;
/*
GETS & SETS
*/
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getTxtNome() {
return txtNome;
}
public void setTxtNome(String txtNome) {
this.txtNome = txtNome;
}
}[/code]
[code]import javax.persistence.*;
import com.azuradesign.azuraimoveis.util.TipoImovel;
@Entity
@Table(name=“tb_imoveisdados”)
public class Imovel {
@Id
@GeneratedValue
@Column(name="id")
private int id;
@Column(name="hashImovel", length=32, nullable=true)
private String hash;
@Column(name="tipoImovel", length=3, nullable=true)
private TipoImovel tipoImovel;
/*
GETS & SETS
*/
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getHash() {
return hash;
}
public void setHash(String hash) {
this.hash = hash;
}
public TipoImovel getTipoImovel() {
return tipoImovel;
}
public void setTipoImovel(TipoImovel tipoImovel) {
this.tipoImovel = tipoImovel;
}
}[/code]
Como ficaria o mapeamento via annotation para uma classe que possui outra classe dentro?, no caso a classe Imovel possui um TipoImovel (classe => classe, classe para classe)?
estu tendo este erro:
Obrigado a quem puder ajudar.