I am building a Spring/Hibernate/Postgres api, which works fine. I want to write an integration test using in memory H2 DB.I know that how to create test-applicationContext. But I am having few issues creating the tables.
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="org.h2.Driver" />
<property name="url" value="jdbc:h2:mem:processdb;INIT=RUNSCRIPT FROM 'classpath:create.sql'"
/>
</bean>
right now the create.sql had a sql query to create the needed schema and tables. But Hiberate should take care of it and I think I do not have to use a query to create table, hibernate should take care of it from the model annotations? I have everything defined in my persistence.xml but at the end it says the table "user" cannot be found. Can any one suggest me how to create tables in integration test or point me in the right direction, Please? Thanks