Sto integrando spring con hibernate, sto usando i file di confutazione di dropwizard come: persistence file ha i file di configurazione nella cartella resources nessun problema con il caricamento di file xml. C'è un problema con la tabella trovata. file persistence.xml come:integrazione di primavera + ibernazione manca "table_name"
<persistence-unit name="bfm" transaction-type="RESOURCE_LOCAL" >
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>com.bcits.parkingmanagement.model.User</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<!-- Configuring JDBC properties -->
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/anuj" />
<property name="javax.persistence.jdbc.user" value="root" />
<property name="javax.persistence.jdbc.password" value="root" />
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
</persistence-unit>
</persistence>
In applicazione primavera config xml come: lì ho mostrare ibernazione unica configurazione
<context:annotation-config />
<context:component-scan base-package="com.bcits.parkingmanagement.model" />
<jdbc:embedded-database id="dataSource" type="HSQL" />
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceXmlLocation" value="classpath:spring/persistence.xml" />
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<bean id="entityManager"
class="org.springframework.orm.jpa.support.SharedEntityManagerBean">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
tabella utente mancante
javax.persistence.PersistenceException: [PersistenceUnit: bfm] Unable to build EntityManagerFactory
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1562)
... 18 more
Caused by: org.hibernate.HibernateException: Missing table: user
Si prega chiunque aiutami come posso risolvere questo errore. Voglio la configurazione di primavera con hibernate.Io cosa è connettersi al database ma non è possibile trovare la tabella. Nome della tabella e nome del colume esattamente lo stesso. Anche il nome del database è corretto e nessun problema con nome utente e password del database.
Mostra la classe del modello Utente. In secondo luogo. Avete un DB chiamato Anuj e una tabella con nome utente in questo? –
Sì "@" Entità "@" Tabella (name = "user") public class User { \t \t "@" Id \t "@" Colonna (name = "user_id") \t privato int id; \t "@" Colonna (nome = "nome_utente") \t Nome stringa privato; // getter and setter} –
Modifica il tuo post principale per incollare il nuovo contenuto. –