Hi all,
Im using jboss 403rc1 and trying to deploy my ear file (with a PAR file).
The problem occurs with @EmbeddableSuperclass...
I'm using this annotation to inherit ID (and others) properties...like described in EJB3 specification of Jun 25, 2005.
My classes are:
Code:
//Provide ID and audit fields to all classes
@EmbeddableSuperclass(access=javax.persistence.AccessType.PROPERTY)
public abstract class Persistente implements Serializable {
protected Long id;
protected Date insertDate;
protected Date updateDate;
protected String user;
protected Integer version;
@Id(generate = GeneratorType.AUTO)
public Long getId() {
return id;
}
//getters and setters with tags...
}
//Provide basic fields to a group of similar classes...
@EmbeddableSuperclass
public abstract class BaseBean extends Persistente {
protected String nome;
protected String descricao;
//getters and setters with tags...
}
//Represent an element in access control
@Entity
@Inheritance(strategy = javax.persistence.InheritanceType.JOINED)
@Table(name="IntegranteGu3L")
public abstract class Integrante extends BaseBean {
protected String email;
protected List<Grupo> grupos; //inverse collection of Grupo.integrantes
//getters and setters with tags...
}
//Represent an user in access control
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "UsuarioGu3L")
public class Usuario extends Integrante {
protected String password;
//getters and setters with tags...
}
//Represent a group of "Integrante" in access control
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = "GrupoGu3L")
public class Grupo extends Integrante {
protected List<Integrante> integrantes; //owner collection of Integrante.grupos
//getters and setters with tags...
}
When I deploy the package (EAR with a PAR file), the error is:
Code:
No identifier specified for entity: Integrante
Well, to resolve this problem, I override "getId" in Integrante, like this:
Code:
//Represent an element in access control
@Entity
@Inheritance(strategy = javax.persistence.InheritanceType.JOINED)
@Table(name="IntegranteGu3L")
public abstract class Integrante extends BaseBean {
protected String email;
protected List<Grupo> grupos; //inverse collection of Grupo.integrantes
@Id(generate = GeneratorType.AUTO)
public Long getId() {
return id;
}
//getters and setters with tags...
}
So, the problem of ID property was solved, but my question is? I NEED override "getId" in all (sub)classes?...
In the same form, when execute a HQL query, like:
Code:
SELECT u.nome FROM Usuario u
The hibernate report that "Usuario" does not have "nome" property...
What it is? And @EmbeddableSuperclass?
Reading posts in forum, I see it:
1)
http://forum.hibernate.org/viewtopic.ph ... highlight=
2)
http://forum.hibernate.org/viewtopic.ph ... hlight=3+1
But, the problem "persists"...