1. How can I specify a directory or directories of classes in hibernate.cfg.xml? coderanch.comHello, I am learning Hibernate and JPA Annotation. The following is what I use to make Hibernate be aware of JPA-annotated classes: ...... config.addAnnotatedClass(Thing.class); config.addAnnotatedClass(Fracture.class); config.addAnnotatedClass(Interest.class); config.addAnnotatedClass(Ancestor.class); config.addAnnotatedClass(Parent.class); ...... It is very tedious to add every class like the above. Is there any way I can use to specify all JPA-annotated classes in a directory or directories in Hibernate.cfg.xml? Thanks for ... |
2. How to map a directory and not concrete cfg.xml file. forum.hibernate.orgHi again, I have a configuration xml file, from which my SessionFactory is configured. I need something like: |