Class to test bank connection with hibernate.
package br.drogaria.main;
public class HibernatUtilTeste {
public static void main(String[] args) {
//abre sessão
HibernateUtil.getFabricaDeSessao().openSession();
//fecha sessão
HibernateUtil.getFabricaDeSessao().close();
}
}
You are giving the errors:
configuration can not be resolved HibernatUtil.java / Drugstore / src / main / java / drugstore / util line 17 Java Problem Description Resource Path Location Type
The line is:
ServiceRegistry registro = new StandardServiceRegistryBuilder()
.applySettings(configuration.getProperties()).build();
configuration can not be resolved HibernatUtil.java / Drugstore / src / main / java / drugstore / util line 18 Java Problem Description Resource Path Location Type
The line is:
SessionFactory fabricaDeSessao = configuration.buildSessionFactory(registro);
HibernateUtil can not be resolved HibernatUtilTeste.java / Drugstore / src / main / java / drugstore / main line 7 Java Problem Description Resource Path Location Type
The line is:
HibernateUtil.getFabricaDeSessao().openSession();
The method buildFabricaDeSessao () is undefined for the type HibernatUtil HibernatUtil.java / Drugstore / src / main / java / br / drugstore / util line 9 Java Problem Description Resource Path Location Type
The line is:
private static final SessionFactory fabricaDeSessao = buildFabricaDeSessao();
Obs, I did not understand why the project did not create the web-in folder. I will create in the hand and put the web.xml there, since it is also giving error for lack of this file.
The webapp folder is empty. It has no web-inf or meta-inf. The full path is:
C: \ sampleSpring \ Drugstore \ src \ main \ webapp >
Follow the structure of web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
id="WebApp_ID" version="3.1">
<!-- Nome da Aplicação -->
<display-name>Drogaria</display-name>
</web-app>
I've got the video description link.
Anything put the structure of hibernat.cfg.xml and pom.xml