ola, estou com um problema com o hibernate, tenho uma classe logradouro, uma cliente e outra endereco,
segue:
@Entity
public class Cliente {
@Id
@GeneratedValue
private Integer id;
private String cpfCnpj;
private String nome;
private String email;
@Embedded
@Access(AccessType.PROPERTY)
private Endereco endereco = new Endereco();
//Getters and setters
}
@Embeddable
public class Endereco {
@ManyToOne
@JoinColumn(name = "idLogradouro")
private Logradouro logradouro;
private String numero;
private String complemento;
private String latitude;
private String longitude;
//getters and setters
}
@Entity
public class Logradouro {
@Id
private Integer id;
@ManyToOne
@JoinColumn(name = "idBairro")
private Bairro bairro;
private String cep;
private String nome;
//getters and setters
}
Porem esta dando o seguinte erro na hora de exportar o schema:
Exception in thread "main" org.hibernate.MappingException: Could not determine type for: br.com.estudo.entity.Logradouro, at table: Cliente, for columns: [org.hibernate.mapping.Column(logradouro)]
at org.hibernate.mapping.SimpleValue.getType(SimpleValue.java:290)
at org.hibernate.mapping.Column.getSqlTypeCode(Column.java:164)
at org.hibernate.mapping.Column.getSqlType(Column.java:208)
at org.hibernate.mapping.Table.sqlCreateString(Table.java:419)
at org.hibernate.cfg.Configuration.generateSchemaCreationScript(Configuration.java:930)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:129)
at org.hibernate.tool.hbm2ddl.SchemaExport.<init>(SchemaExport.java:91)
at br.com.guiaonline.util.HibernateSchemaExport.main(HibernateSchemaExport.java:17)
o estou fazendo de errado?