Skip to content
Snippets Groups Projects
Commit cf0768ae authored by Goik Martin's avatar Goik Martin
Browse files

Better PU naming, mvn test --> mvn generate-sources

parent 85c4fa4c
No related branches found
No related tags found
No related merge requests found
......@@ -16,9 +16,11 @@ public class CreateEntity {
static final Logger log = LogManager.getLogger(CreateEntity.class);
// This requires a corresponding entry <persistence-unit name="entitytemplatePU">
// in META-INF/persistence.xml
static public final String PERSISTENCE_UNIT_NAME = "entitytemplatePU";
/**
* This refers to a corresponding element <persistence-unit name = "strategy_drop-and-create" >
* in META-INF/persistence.xml re-creating the relational database schema.
*/
static public final String PERSISTENCE_UNIT_NAME = "strategy_drop-and-create";
/**
* @param args Unused
*/
......
......@@ -22,8 +22,10 @@ import ${package}.model.Airline_;
public class SearchByIcao {
static final Logger log = LogManager.getLogger(SearchByIcao.class);
// This refers to a corresponding entry <persistence-unit name="entitytemplatePU_nocreate">
// in META-INF/persistence.xml
/**
* This refers to a corresponding element <persistence-unit name = "strategy_none" >
* in META-INF/persistence.xml preserving the relational database schema.
*/
static public final String PERSISTENCE_UNIT_NAME = "entitytemplatePU_nocreate";
/**
* @param args Unused
......@@ -43,10 +45,10 @@ public class SearchByIcao {
final Root<Airline> airlineRoot = criteria.from( Airline.class );
criteria.select( airlineRoot );
// The subsequent line of code requires "mvn test" or equivalent triggering the metamodel generator
// The subsequent line of code requires "mvn generate-sources" or equivalent triggering the metamodel generator
// when working in Eclipse. You may want to right click on your project root choosing
//
// "Run As" --> "Maven test".
// "Run As" --> "Maven generate-sources".
//
// This step is being required whenever changes to your model classes in mi.intro.jpastart.model happen.
......
......@@ -12,7 +12,7 @@
The <code>persistence.xml</code> file configures at least one persistence unit;
each unit must have a unique name.
-->
<persistence-unit name="entitytemplatePU">
<persistence-unit name="strategy_drop-and-create">
<!--
Hibernate will scan your classpath for mapped classes and add them automatically
......@@ -70,7 +70,7 @@
<!-- The subsequent persistence unit won't modify the database's schema
javax.persistence.schema-generation.database.action=none
-->
<persistence-unit name="entitytemplatePU_nocreate">
<persistence-unit name="strategy_none">
<exclude-unlisted-classes>false</exclude-unlisted-classes>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment