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 6206199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:24:35+00:00 2026-05-24T05:24:35+00:00

I am having a JPA entity for User. I want to generate a sql

  • 0

I am having a JPA entity for “User”. I want to generate a sql statement for this entity using maven hibernate3 Plugin. I tried using persistence.xml as configured in https://stackoverflow.com/questions/6855119/how-to-generate-schema-through-hibernate3hbdml-in-persistence-xml but my configuration fails. How to configure persistence.xml with any simple database and access the table created using maven hibernate3:hbm2ddl plugin.

  • 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-24T05:24:35+00:00Added an answer on May 24, 2026 at 5:24 am

    Here is my example configuration for HSQLdb which generates src/main/resources/db-scheme.sql:

    From pom.xml:

    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>hibernate3-maven-plugin</artifactId>
        <version>2.2</version>
        <configuration>
            <components>
                <component>
                    <name>hbm2ddl</name>
                    <implementation>jpaconfiguration</implementation>
                    <outputDirectory>
                        src/main/resources
                    </outputDirectory>
                </component>
            </components>
            <componentProperties>
                <console>false</console>
                <format>true</format>
                <jdk5>true</jdk5>
                <propertyfile>
                    src/main/resources/database.properties
                </propertyfile>
                <outputfilename>db-scheme.sql</outputfilename>
                <export>false</export>
            </componentProperties>
        </configuration>
        <dependencies>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-core</artifactId>
                <version>3.6.5.Final</version>
            </dependency>
            <dependency>
                <groupId>org.hibernate</groupId>
                <artifactId>hibernate-entitymanager</artifactId>
                <version>3.6.5.Final</version>
            </dependency>
            <dependency>
                <groupId>javax.validation</groupId>
                <artifactId>validation-api</artifactId>
                <version>1.0.0.GA</version>
            </dependency>
        </dependencies>
    </plugin>
    

    src/main/resources/database.properties:

    hibernate.formatSql=true
    hibernate.hbm2ddl.auto=validate
    
    # needed for hibernate3-maven-plugin
    hibernate.dialect=org.hibernate.dialect.HSQLDialect
    

    src/main/resources/META-INF/persistence.xml:

    <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
        <persistence-unit name="DefaultPersistenceUnit" transaction-type="RESOURCE_LOCAL" />
    </persistence>
    

    HTH

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using JPA for a java class and having trouble putting the persistence
I'm using Maven JPA(hibernate) and Spring3 in my project. I'm having a new problem
I am having trouble deleting orphan nodes using JPA with the following mapping @OneToMany
I'm trying to generate JPA entities out of an existing database having an interesting
I'm using Hibernate's JPA impl to model some tables. I'm having trouble mapping a
I am trying to set up Entity Inheritance using JPA annotations and abstract classes.
I have a mapping class using JPA annotations, and I want it to use
I am using JPA with Hibernate underneath, and I am having trouble getting merge
I'm having a bit of trouble with one particular issue using JPA/Spring: How can
In my application am using JPA entity manager to persist data/fetch data. em.executeQuery(select *

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.