I am trying to create tables on DB automatically and want to import initial data only once. It is working when set the "hibernate.hbm2ddl.auto" to "create" and "hibernate.hbm2ddl.import_files" on hibernate.cfg.xml. However, it destroys and create DB every run. I want to create tables if not exist, to do that I changed paramater to "update", but this time "hibernate.hbm2ddl.import_files" is not working.
org.apache.derby.jdbc.EmbeddedDriver jdbc:derby:CounterDB;create=true 5
<property name="dialect">org.hibernate.dialect.DerbyDialect</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.show_sql">true</property>
<!-- Creates it only if it doesn't exist -->
<property name="hibernate.hbm2ddl.auto">update</property>
<!-- import initial data to Database when it created -->
<property name="hibernate.hbm2ddl.import_files">import.sql</property>
<!-- Mapping files -->
<mapping class="com.counter.db.CameraSettings" />
<mapping class="com.db.Counts" />