I've seen lot's of people writing (or using) third party abstraction frameworks on
top of ORM solutions like Hibernate so that they can potentially get rid of one ORM
engine to another (or even an other technology).
Such frameworks are even considered by some architectsas a must-have.
Packaging has always been a manual operation in ORM world. In Hibernate, you have to
list the mapped entities either through the configuration API or through the hibernate.cfg.xml
file. For a while now, JBoss AS has introduced the notion of .har, basically an archive scanned
by the deployer to discover the Hibernate configuration and the hbm.xml files in it.
We just released the brand new Hibernate Annotations module as an alpha version.
This module provides the Hibernate facilities to declare Hibernate O/R mapping metadata
through JDK 5.0 metadata annotations (instead of XML mapping files or
XDoclet preprocessing). We have implemented the EJB3 (JSR-220) O/R metadata annotations defined
in the early draft 1 of the spec.
This set of annotations covers all common mappings cases.
It happens sometimes that a domain model objet dettached from a previous session needs/can
be reattached without trigging an UPDATE (whether it has optimistic locking or not).
Hibernate supports this kind of feature by providing:
Maybe you haven't noticed, but every single piece of information on JDK 1.5 Metadata
Annotations is nothing but a simple /Hello World/ tutorial (of course, I exclude the
specification). There is no real world implementation. This is especially true for
codes processing the annotations. I'll call such an application an annotation reader.