Galera boa tarde.
Seguinte digamos que temos 3 tabelas na base:
[code]
TB_USER(id_user)
TB_MENU(id_menu)
TB_PERMISSION(id_user FK, id_menu FK)[/code]A Classe Permission representa a última tabela, usei a seguinte anotação.
[code]public class Permission implements SimpleBean {
@OneToOne(fetch = FetchType.EAGER)
@PrimaryKeyJoinColumn
private User user;
@OneToOne(fetch = FetchType.EAGER)
@PrimaryKeyJoinColumn
private Menu menu;
// Get's, set's e sobrepus hashCode e equals
}[/code]Quando tento subir o Hibernate lança essa exceção Caused by: org.hibernate.AnnotationException: No identifier specified for entity: br.com.sjf.hibernate.beans.Permission
dizendo que não tem campo Id da tabela mas a anotação @PrimaryKeyJoinColumn não seria o identificador? Consultei a Api mas lá tanb não explica com muitos detalhes…
Obrigado.
Sem mais, Rodrigo.