Reputation: 10531
I am reading an example of Java EE (JBoss) application, and learning the basics of Hibernate in Java EE. Under src/main/resources/META-INF/persistence.xml:
<jta-data-source>java:jboss/datasources/MemberDS</jta-data-source>
<properties>
<!-- Properties for Hibernate -->
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" value="false" />
</properties>
</persistence-unit>
Under src/main/resources/import.sql:
insert into Member (id, name, email, password, phone_number) values (0, 'John Smith', '[email protected]', 'password', '2125551212')
Under model package, it has a Member class.
My questions:
Upvotes: 0
Views: 1446
Reputation: 97162
The answers to your questions, in order:
Member
table in database?CREATE TABLE
statement.import.sql
automically executed once the application is running?import.sql
file from the root of your classpath if the hibernate.hbm2ddl.auto
property is set to create
(files to be imported can be further specified using the hibernate.hbm2ddl.import_files
property).Upvotes: 3