I have followed this tutorial.
Here is my folder structure:
When I run App.Java, I get:
Initial SessionFactory creation failed.org.hibernate.MappingNotFoundException: resource: com/mkyong/user/DBUser.hbm.xml not found
However, I have that file there as you can see it. When I put the file under
src/main/java/com/mykong/user/DBUser.hbm.xml
I am still getting this error.
How can I make this example work?
Thank you.
Edit:
hibernate.cfg.xml
<hibernate-configuration>
<session-factory>
<property name="connection.url">jdbc:mysql://localhost:3306/sampleapplication</property>
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.username">root</property>
<property name="connection.password">MYPASSWORDHERE</property>
<property name="show_sql">true</property>
<mapping resource="com/mkyong/user/DBUser.hbm.xml"></mapping>
</session-factory>
</hibernate-configuration>