Bonjour,

j'ai crée un projet EJB et j'utilise entity manager ( config:data source et persitence.xml )
comment puis-je ajouté la propriété hibernate.hbm2ddl.auto?
j'ai ajouté cette propriété au fichier persitence.xml mais ca marche pas

Merci pour votre aide

persistence.xml:

Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?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="UniQPersistence" transaction-type="JTA">
 
             <jta-data-source>java:jboss/datasources/DefaultDS</jta-data-source>
 
             <properties>
              <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
            <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/uniqdba" />
            <property name="javax.persistence.jdbc.user" value="root" />
            <property name="javax.persistence.jdbc.password" value="root" />
 
            <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
             <property name="hibernate.hbm2.auto" value="update"/>
             <property name="hibernate.show_sql" value="true"/>
             <property name="hibernate.c3p0.timeout" value="500"/>
             </properties>
 
 
            </persistence-unit> 
 
             </persistence>


Standalone.xml:

Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
<datasource jta="true" jndi-name="java:jboss/datasources/DefaultDS" pool-name="DefaultDS" enabled="true" use-java-context="true">
                    <connection-url>jdbc:mysql://localhost:3306/uniqdba</connection-url>
                    <driver>mysqlDriver</driver>
                    <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
                    <security>
                        <user-name>root</user-name>
                        <password>root</password>
                    </security>
                </datasource>