'I can't create table with hibernate
I created a jpa xml EntityManagerFactory. After running tomcat, and Hibernate create table in console, but when I checked the database , I didn't see the table. What's the problem ?


<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter"/>
<property name="jpaProperties">
<props>
<prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
</props>
</property>
<property name="packagesToScan" value="com.example.hospitalmanage.model"></property>
</bean>
Solution 1:[1]
Ensure all models are in package com.example.hospitalmanage.model
- User
- user_diagnosis
- user_treatments
- user_videos
All should be inside the same package.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | pepitoenpeligro |
