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', 'john.smith@mailinator.com', 'password', '2125551212')
Under model package, it has a Member class.
My questions:
- how does the application automatically create the Table Member in database?
- Where does it get the schema information?
- Why and how 'import.sql' is atomically executed once the application is running?