Reputation: 56944
I just read an introductory tutorial on Hibernate that had all the mapping files inside the same source directory of the entities they represented:
TestProject/
src/main/java/
com.hibernate.tutorial.entities
Student.java
Student.hbm.xml
Course.java
Course.hbm.xml
etc. Normally, I like to place config files under src/main/config
, and so ideally I'd like to have the following project directory structure:
TestProject/
src/main/java/
com.hibernate.tutorial.entities
Student.java
Course.java
src/main/config
hibernate/
Student.hbm.xml
Course.hbm.xml
Is there a way to do this, and if so, how?
Upvotes: 0
Views: 351
Reputation: 39456
There are 2 ways to map Pojo class to hibernate entity:
Annotations becomes more prevalent last years. Some examples you could find here:
Upvotes: 1