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
d714afb3
Commit
d714afb3
authored
8 years ago
by
Goik Martin
Browse files
Options
Downloads
Patches
Plain Diff
Streamlining with MI JPA archetype
parent
82bbd95b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
P/Sda1/Jpa/HibernateStandalone/pom.xml
+54
-59
54 additions, 59 deletions
P/Sda1/Jpa/HibernateStandalone/pom.xml
P/Sda1/Jpa/HibernateStandalone/src/main/resources/META-INF/persistence.xml
+60
-25
60 additions, 25 deletions
...ateStandalone/src/main/resources/META-INF/persistence.xml
with
114 additions
and
84 deletions
P/Sda1/Jpa/HibernateStandalone/pom.xml
+
54
−
59
View file @
d714afb3
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<groupId>
de.hdm-stuttgart.mi
</groupId>
<artifactId>
lecturenotes-pom
</artifactId>
<version>
1.0
</version>
<relativePath>
../../../pom.xml
</relativePath>
</parent>
<parent>
<groupId>
de.hdm-stuttgart.mi
</groupId>
<artifactId>
lecturenotes-pom
</artifactId>
<version>
1.0
</version>
<relativePath>
../../../pom.xml
</relativePath>
</parent>
<groupId>
de.hdm-stuttgart.mi.sda1
</groupId>
<artifactId>
mi-hibernate-standalone
</artifactId>
<version>
0.
0.
1
</version>
<packaging>
jar
</packaging>
<groupId>
de.hdm-stuttgart.mi.sda1
</groupId>
<artifactId>
mi-hibernate-standalone
</artifactId>
<version>
0.1
</version>
<packaging>
jar
</packaging>
<name>
MI-hibernate-standalone
</name>
<name>
MI-hibernate-standalone
</name>
<url>
http://www.mi.hdm-stuttgart.de/freedocs
</url>
<dependencies>
<url>
http://www.mi.hdm-stuttgart.de/freedocs
</url>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-entitymanager
</artifactId>
<version>
5.0.0.CR1
</version>
</dependency>
<dependencies>
<dependency>
<groupId>
org.hibernate
.javax.persistence
</groupId>
<artifactId>
hibernate-
jpa-2.1-api
</artifactId>
<version>
1.0
.0.Final
</version>
</dependency>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-
entitymanager
</artifactId>
<version>
5.1
.0.Final
</version>
</dependency>
<dependency>
<groupId>
org.hibernate
</groupId>
<artifactId>
hibernate-c3p0
</artifactId>
<version>
5.
0.0.CR1
</version>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
5.
1.38
</version>
</dependency>
<dependency>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<version>
${mysql.mysql-connector-java.version}
</version>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.12
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
<build>
<plugins>
<dependency>
<groupId>
org.apache.logging.log4j
</groupId>
<artifactId>
log4j-core
</artifactId>
<version>
2.6
</version>
</dependency>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.1
</version>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
</configuration>
</plugin>
</dependencies>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-javadoc-plugin
</artifactId>
<version>
2.10.1
</version>
<configuration/>
</plugin>
</plugins>
</build>
</project>
<build>
<plugins>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-compiler-plugin
</artifactId>
<version>
3.5.1
</version>
<configuration>
<source>
1.8
</source>
<target>
1.8
</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
P/Sda1/Jpa/HibernateStandalone/src/main/resources/META-INF/persistence.xml
+
60
−
25
View file @
d714afb3
<persistence
xmlns=
"http://xmlns.jcp.org/xml/ns/persistence"
<persistence
version=
"2.1"
xmlns=
"http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
version=
"2.1"
>
<persistence-unit
name=
"jpa-recreate"
transaction-type=
"RESOURCE_LOCAL"
>
<provider>
org.hibernate.jpa.HibernatePersistenceProvider
</provider>
xsi:schemaLocation=
"http://xmlns.jcp.org/xml/ns/persistence
http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
>
<!--
The <code>persistence.xml</code> file configures at least one persistence unit;
each unit must have a unique name.
-->
<persistence-unit
name=
"jpa-recreate"
>
<!--
Hibernate will scan your classpath for mapped classes and add them automatically
to your persistence unit.
-->
<exclude-unlisted-classes>
false
</exclude-unlisted-classes>
<!--
setting the previous option "exclude-unlisted-classes" to 'true' requires entity classes to
be listed explicitely. You may want to uncomment the following definition and add more classes.
<class>de.mi.hdm_stuttgart.Airline</class>
-->
<!--
Standard or vendor-specific options can be set as properties on a persistence unit.
Any standard properties have the <code>javax.persistence</code> name prefix, Hibernate's
settings use <code>hibernate</code>
-->
<properties>
<property
name=
"javax.persistence.jdbc.url"
value=
"jdbc:mysql://localhost/hdm"
/>
<property
name=
"javax.persistence.jdbc.user"
value=
"hdmuser"
/>
<property
name=
"javax.persistence.jdbc.password"
value=
"XYZ"
/>
<property
name=
"javax.persistence.jdbc.driver"
value=
"com.mysql.jdbc.Driver"
/>
<property
name=
"hibernate.show_sql"
value=
"true"
/>
<property
name=
"hibernate.format_sql"
value=
"true"
/>
<!--
JDBC database connection parameter
-->
<property
name=
"javax.persistence.jdbc.driver"
value=
"com.mysql.jdbc.Driver"
/>
<property
name=
"javax.persistence.jdbc.url"
value=
"jdbc:mysql://localhost:3306/hdm?useSSL=false"
/>
<property
name=
"javax.persistence.jdbc.user"
value=
"hdmuser"
/>
<property
name=
"javax.persistence.jdbc.password"
value=
"XYZ"
/>
<!--
The JPA engine should drop and re-create the SQL schema in the database
automatically when it boots. This is ideal for automated testing, when
you want to work with a clean database for every test run.
-->
<property
name=
"javax.persistence.schema-generation.database.action"
value=
"drop-and-create"
/>
<!--
When printing SQL in logs, let Hibernate format the SQL nicely and generate
comments into the SQL string so we know why Hibernate executed the SQL statement.
-->
<property
name=
"hibernate.format_sql"
value=
"true"
/>
<property
name=
"hibernate.use_sql_comments"
value=
"true"
/>
<!-- Choose Mysql innodb backend -->
<property
name=
"hibernate.dialect"
value=
"org.hibernate.dialect.MySQL5InnoDBDialect"
/>
<property
name=
"hibernate.hbm2ddl.auto"
value=
"create-drop"
/>
<!-- Configuring Connection Pool -->
<!-- Enable Hibernate scanning for entity classes and adding them automatically
but not for hbm.xml files. -->
<property
name=
"hibernate.archive.autodetection"
value=
"class"
/>
<property
name=
"hibernate.c3p0.min_size"
value=
"5"
/>
<property
name=
"hibernate.c3p0.max_size"
value=
"20"
/>
<property
name=
"hibernate.c3p0.timeout"
value=
"500"
/>
<property
name=
"hibernate.c3p0.max_statements"
value=
"50"
/>
<property
name=
"hibernate.c3p0.idle_test_period"
value=
"2000"
/>
</properties>
</persistence-unit>
</persistence>
\ No newline at end of file
</persistence>
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