Skip to content

Commit f401f6b

Browse files
committed
JAVA-8357: Split or move hibernate-jpa module
1 parent b4e0ac6 commit f401f6b

File tree

9 files changed

+30
-19
lines changed

9 files changed

+30
-19
lines changed

persistence-modules/hibernate-exceptions/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
- [Hibernate Error “No Persistence Provider for EntityManager”](https://www.baeldung.com/hibernate-no-persistence-provider)
55
- [TransactionRequiredException Error](https://www.baeldung.com/jpa-transaction-required-exception)
66
- [Hibernate’s “Object References an Unsaved Transient Instance” Error](https://www.baeldung.com/hibernate-unsaved-transient-instance-error)
7+
- [EntityNotFoundException in Hibernate](https://www.baeldung.com/hibernate-entitynotfoundexception)

persistence-modules/hibernate-exceptions/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@
2929
<artifactId>jaxb-api</artifactId>
3030
<version>${jaxb.version}</version>
3131
</dependency>
32+
<dependency>
33+
<groupId>com.h2database</groupId>
34+
<artifactId>h2</artifactId>
35+
<version>${h2.version}</version>
36+
</dependency>
3237
</dependencies>
3338

3439
<properties>

persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/entitynotfoundexception/Category.java renamed to persistence-modules/hibernate-exceptions/src/main/java/com/baeldung/hibernate/entitynotfoundexception/Category.java

File renamed without changes.

persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/entitynotfoundexception/Item.java renamed to persistence-modules/hibernate-exceptions/src/main/java/com/baeldung/hibernate/entitynotfoundexception/Item.java

File renamed without changes.

persistence-modules/hibernate-jpa/src/main/java/com/baeldung/hibernate/entitynotfoundexception/User.java renamed to persistence-modules/hibernate-exceptions/src/main/java/com/baeldung/hibernate/entitynotfoundexception/User.java

File renamed without changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
5+
version="2.0">
6+
<persistence-unit name="com.baeldung.hibernate.entitynotfoundexception.h2_persistence_unit">
7+
<description>EntityManager EntityNotFoundException persistence unit</description>
8+
<class>com.baeldung.hibernate.entitynotfoundexception.Category</class>
9+
<class>com.baeldung.hibernate.entitynotfoundexception.Item</class>
10+
<class>com.baeldung.hibernate.entitynotfoundexception.User</class>
11+
<exclude-unlisted-classes>true</exclude-unlisted-classes>
12+
<properties>
13+
<property name="hibernate.hbm2ddl.auto" value="update"/>
14+
<property name="hibernate.show_sql" value="true"/>
15+
<property name="hibernate.generate_statistics" value="false"/>
16+
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
17+
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
18+
<property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:db3;DB_CLOSE_DELAY=-1"/>
19+
<property name="javax.persistence.jdbc.user" value="sa"/>
20+
<property name="javax.persistence.jdbc.password" value=""/>
21+
</properties>
22+
</persistence-unit>
23+
</persistence>

persistence-modules/hibernate-jpa/src/test/java/com/baeldung/hibernate/entitynotfoundexception/EntityNotFoundExceptionIntegrationTest.java renamed to persistence-modules/hibernate-exceptions/src/test/java/com/baeldung/hibernate/entitynotfoundexception/EntityNotFoundExceptionIntegrationTest.java

File renamed without changes.

persistence-modules/hibernate-jpa/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ This module contains articles specific to use of Hibernate as a JPA implementati
1313
- [Enabling Transaction Locks in Spring Data JPA](https://www.baeldung.com/java-jpa-transaction-locks)
1414
- [JPA/Hibernate Persistence Context](https://www.baeldung.com/jpa-hibernate-persistence-context)
1515
- [Quick Guide to EntityManager#getReference()](https://www.baeldung.com/jpa-entity-manager-get-reference)
16-
- [JPA Entities and the Serializable Interface](https://www.baeldung.com/jpa-entities-serializable)
17-
- [EntityNotFoundException in Hibernate](https://www.baeldung.com/hibernate-entitynotfoundexception)
16+
- [JPA Entities and the Serializable Interface](https://www.baeldung.com/jpa-entities-serializable)

persistence-modules/hibernate-jpa/src/main/resources/META-INF/persistence.xml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -120,21 +120,4 @@
120120
</properties>
121121
</persistence-unit>
122122

123-
<persistence-unit name="com.baeldung.hibernate.entitynotfoundexception.h2_persistence_unit">
124-
<description>EntityManager EntityNotFoundException persistence unit</description>
125-
<class>com.baeldung.hibernate.entitynotfoundexception.Category</class>
126-
<class>com.baeldung.hibernate.entitynotfoundexception.Item</class>
127-
<class>com.baeldung.hibernate.entitynotfoundexception.User</class>
128-
<exclude-unlisted-classes>true</exclude-unlisted-classes>
129-
<properties>
130-
<property name="hibernate.hbm2ddl.auto" value="update"/>
131-
<property name="hibernate.show_sql" value="true"/>
132-
<property name="hibernate.generate_statistics" value="false"/>
133-
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
134-
<property name="javax.persistence.jdbc.driver" value="org.h2.Driver"/>
135-
<property name="javax.persistence.jdbc.url" value="jdbc:h2:mem:db3;DB_CLOSE_DELAY=-1"/>
136-
<property name="javax.persistence.jdbc.user" value="sa"/>
137-
<property name="javax.persistence.jdbc.password" value=""/>
138-
</properties>
139-
</persistence-unit>
140123
</persistence>

0 commit comments

Comments
 (0)