Quote:
IAs far as I know Hibernate is a JPA implementation, isn't it?
JPA is a standard specification for persistence made by the Java_Community
http://en.wikipedia.org/wiki/Java_Community_Processand Hibernate is since longer time (I believe since version 3) an implementor of JPA.
Quote:
Is JPA a complete different system?
I would say no.
The main access class with JPA is the
entitymanager whilst with plain 'old-style' hibernate it is the
session.
Both classes have very similiar methods and it is also allowed to use both interfaces contemporaneosly,
as most implementation behind JPA delegates to plain hiberante
Code:
Session hibernatesession = (Session) entitymanager.getDelegate();
As you use annotations, like @PreRemove, @PostRemove you have to use the JPA approach (persistence.xml)
or AnnotationConfiguration in order that your annotation are properly parsed.
With old-style hibernate configuraton it may happen that only hbm-files are be parsed whilst your annotations are ignored. I suppose this is the reason why mmerder asked you if you are using JPA or plain hibernate?