i'm trying to start my understanding of Hibernate . But I have a problem. With my researches I found lots of things but nothing to fix my issues.. "org.hibernate.ejb.HibernatePersistence is written in red color.
My persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="demojpa">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.archive.autodetection" value="class"/>
<property name="hibernate.format_sql" value="true"/>
<!-- Configuration de la BDD -->
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/demojpa" />
<property name="javax.persistence.jdbc.user" value="root" />
<property name="javax.persistence.jdbc.password" value="" />
<!-- Specifie le dialecte SQL utilisé pour communiquer avec la BDD -->
<property name="hibernate.dialect" value="org.hibernate.dialect.MYSQLDialect"/>
<!-- Indique a Hibernate de re-creer la BDD au lancement de l'applciation -->
<property name="hbm2ddl.auto" value="create"/>
</properties>
</persistence-unit>
</persistence>
my class
public class DemoJpa {
public static void main(String[] args) {
// 1 Ouverture unité de travail JPA
EntityManagerFactory emf = Persistence.createEntityManagerFactory("demojpa");
EntityManager em = emf.createEntityManager();
}
To finish a picture of my root... Because I think there is a problem in this one....
Thanks everyone for your help!