Rigth now, the only way to map annotated classes is to use the programmatic API
AnnotationConfiguration ac = new AnnotationConfiguration(); ac.addPackage("my.package"); ac.addAnnotatedClass(MyClass.class); ...
Users ( and Max ;-) ) ask for declarative configuration. The best way seems to enhance the hibernate.cfg.xml DTD to allow <mapping annotatedPackage="my.package"/> <mapping annotatedClass="my.package.MyClass"/>
why not just:
<mapping package="my.package"/> <mapping class="my.package.MyClass"/>
And let the specific Configuration instance take care on how it interpret this ?
package it probably can't do much with (except log an error or throw an exception).
With class it could do addClass(Class).
And in AnnotationConfiguration you would do your thing and fallback to Configuration behavior
if nothing is available at package or class level.
If that is too "implicit" then annotatedPackage and annotatedClass is find by me, but
i would simply let core Configuration throw an exception on it and only have AnnotationConfiguration
work with it.
What does addPackage actually do ? Add package-level annotations such as.. ?
... and *not* to add hard dependency from core to annotations. I can add a weak dependency getting AnnotationConfiguration through its string name and catching the ClassNotFoundException if AnnotationConfiguration is requested.
And what class should do this ? Can't see this...please explain ,)
-- Max Rydahl Andersen callto://max.rydahl.andersen
Hibernate [EMAIL PROTECTED] http://hibernate.org
JBoss Inc [EMAIL PROTECTED] http://jboss.com
------------------------------------------------------- The SF.Net email is sponsored by: Beat the post-holiday blues Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek. It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt _______________________________________________ hibernate-devel mailing list hibernate-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hibernate-devel