Bonjour,
je suis sur une application web:spring,jpa,hibernate,jsf,mysql
si quelqu'un peut jeter un coup d'oeil à mon fichier de configuration spring, mon probléme est que
les tables ne sont pas générées automatiquement par jpa!!
Code XML :
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p" xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="com.mysql.jdbc.Driver" p:url="jdbc:mysql://localhost:3306/mabase"
p:username="sa" p:password="" />
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
p:dataSource-ref="dataSource" p:persistence-unit-name="test">
<property name="jpaVendorAdapter">
<bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
p:database="MYSQL" p:databasePlatform="org.hibernate.dialect.MySQL5Dialect"
p:showSql="true" p:generate-ddl="true" />
</property>
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
p:entityManagerFactory-ref="entityManagerFactory" />
<context:annotation-config />
<context:annotation-config />
<context:component-scan base-package="entity" />
<context:component-scan base-package="control" />
<context:component-scan base-package="lifeCycle" />
<tx:annotation-driven />
</beans>
normalement avec:
p:generate-ddl="true" ça devrait générer automatiquement les tables!
notez que ma base elle existe (je l'ai créer à la main)