Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GoikLectures
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Goik Martin
GoikLectures
Commits
505ff7e2
Commit
505ff7e2
authored
8 years ago
by
Goik Martin
Browse files
Options
Downloads
Patches
Plain Diff
Extended documentation
parent
9e5b78b7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ws/Archetypes/mi-maven-archetype-jpa-hibernate/src/main/resources/archetype-resources/Readme.md
+47
-10
47 additions, 10 deletions
...ibernate/src/main/resources/archetype-resources/Readme.md
with
47 additions
and
10 deletions
ws/Archetypes/mi-maven-archetype-jpa-hibernate/src/main/resources/archetype-resources/Readme.md
+
47
−
10
View file @
505ff7e2
JPA 2 project template
======================
Hibernate
JPA 2 project template
======================
==========
General:
--------
Executing »
`mvn test`
« generates metamodel classes being required for
criteria based queries.
This project contains:
src/main/resources/META-INF/persistence.xml
: Defining two persistence units both offering a JDBC database
connection to a Mysql 5 server. You may want to adjust both
database type and connection parameters.
Eclipse users:
--------------
You will have to execute »
`mvn test`
« manually from the command line or by right
clicking on your project's root choosing »
`Run As`
« - - > »
`Maven test`
«. This will
trigger the metamodel generating process resolving a compile time error in
class »
`SearchByIcao`
«.
\ No newline at end of file
: The first unit will re-create the database schema whereas using
the second will preserve your current database schema.
Java classes
:
|Class |Package |Description |
|--------------|----------------------|----------------------|
|
`Airline`
|
`$(packageroot)/model`
|JPA example entity |
|
`CreateEntity`
|
`$(packageroot)`
|Create database schema, persist an instance ofAirline |
|
`SearchByIcao`
|
`$(packageroot)`
|JPA typesafe criteria search demo |
|
`EntityTest`
|
`$(testroot)`
|Persisting and re-reading an object by primary key value |
src/main/resources/log4j2.xml
: Configuring the log4j subsystem.
On executing i.e. »
`mvn install`
« Maven will generate metamodel
classes like
`Airline_.java`
during the »
`generate-sources`
« phase.
These classes are being required for
[typesafe criteria based queries]
(http://docs.jboss.org/hibernate/entitymanager/3.6/reference/en/html/querycriteria.html#querycriteria-typedquery).
as being outlined in class
`$(packageroot)`
/
`SearchByIcao`
.
Eclipse IDE users:
------------------
On initial archetype based project generation your new project's
class »
`SearchByIcao`
« reveals a compile time error indicating a
missing class
`Airline_`
. Possible resolutions:
*
Right click on your project's root choosing
»
`Run As`
« ➩ »
`Maven generate-sources`
«
*
Execute »
`mvn generate-sources`
« manually from the command line.
This step creates missing metamodel classes thereby resolving the error.
When working with the Eclipse IDE (rather than with Maven directly)
this step is required whenever modifying your JPA data model.
IDE problems of this type are due to Eclipse's (and other IDE's)
limited Maven integration. The above workaroud triggers
the metamodel generator explicitely.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment