Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7580561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:56:54+00:00 2026-05-30T17:56:54+00:00

Our application is based on spring, JPA, Hibernate (3.5.1), postgresql 8.4 We will deliver

  • 0

Our application is based on spring, JPA, Hibernate (3.5.1), postgresql 8.4

We will deliver a new .war file to our clients, but we have quite a few new views in the DB needed to be created before they can run some reports.

I tried to put an import.sql file under src folder, and configured my persistence.xml like this
:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" 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_1_0.xsd">
    <persistence-unit name="myApp">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <class>....</class>

       <properties>
           <property name="hibernate.hbm2ddl.auto" value="update" />
             <property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
            <property name="hibernate.show_sql" value="true" />
            <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider" />
        </properties>       
    </persistence-unit>
</persistence>

and my data-access-context.xml like this:

<?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:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    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.jndi.JndiObjectFactoryBean">
          <property name="jndiName"
                      value="java:comp/env/jdbc/mydb"/>   
          <property name="resourceRef"
                      value="true" />
    </bean> 

    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
            <property name="dataSource" ref="dataSource" />
            <property name="persistenceUnitName" value="myApp" />
            <property name="jpaVendorAdapter">
                    <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                            <property name="generateDdl" value="true" />
                            <property name="showSql" value="true" />
                            <property name="databasePlatform" value="org.hibernate.dialect.PostgreSQLDialect" />
                    </bean>
            </property>
    </bean>

    <tx:annotation-driven/>

    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory"/>
    </bean>

    <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />

    <bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>

    <context:component-scan base-package="com.pb.redline.dao" />    


</beans>

But I cannot get the new views created?
any idea? Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T17:56:58+00:00Added an answer on May 30, 2026 at 5:56 pm

    This is not really an answer to your question, but maybe a valuable solution. What about using a database migration framework? I suggest flyway which gives you full access to your database.

    During application start (see post) the migration can be triggered using the flyway java api.

    Properties properties = new Properties();
    properties.setProperty("flyway.user", "postgres");
    properties.setProperty("flyway.password", "secret");
    properties.setProperty("flyway.url", "jdbc:postgresql://localhost/database-name");
    properties.setProperty("flyway.driver", "org.postgresql.Driver");
    
    flyway = new Flyway();
    flyway.configure(properties);
    flyway.clean();
    flyway.migrate(); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Spring MVC based Web Application with Hibernate. Following is the directory
We have a problem in our swing based application since we've upgraded our java
We have a requirement to control access to our SaaS based web application based
We are using Spring+JPA for our RESTful web services application. This is a high
We are working on a Spring 3.0.5 Web MVC-based application. In our code we
We've got a Spring based web application that makes use of Hibernate to load/store
In our application we have implemented role-based forms authentication. This has been handled using
I have a Spring Framework based application which we have previous deployed successfully and
I am designing a plugin system for our web based application using Spring framework.
We are working on developing a Java EE based application. Our application is Java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.