Skip to content

Commit 80853ed

Browse files
committed
JAVA-41259 Moved code of article jpa-get-auto-generated-id from java-jpa-3 to java-jpa
1 parent 6d70b50 commit 80853ed

File tree

7 files changed

+18
-16
lines changed

7 files changed

+18
-16
lines changed

persistence-modules/java-jpa-3/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ This module contains articles about the Java Persistence API (JPA) in Java.
1010
- [JPA CascadeType.REMOVE vs orphanRemoval](https://www.baeldung.com/jpa-cascade-remove-vs-orphanremoval)
1111
- [A Guide to MultipleBagFetchException in Hibernate](https://www.baeldung.com/java-hibernate-multiplebagfetchexception)
1212
- [How to Convert a Hibernate Proxy to a Real Entity Object](https://www.baeldung.com/hibernate-proxy-to-real-entity-object)
13-
- [Returning an Auto-Generated Id with JPA](https://www.baeldung.com/jpa-get-auto-generated-id)
1413
- [How to Return Multiple Entities in JPA Query](https://www.baeldung.com/jpa-return-multiple-entities)
1514
- [Defining Unique Constraints in JPA](https://www.baeldung.com/jpa-unique-constraints)
1615
- [Connecting to a Specific Schema in JDBC](https://www.baeldung.com/jdbc-connect-to-schema)

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,6 @@
9898
</properties>
9999
</persistence-unit>
100100

101-
<persistence-unit name="jpa-h2-id-generation">
102-
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
103-
<class>com.baeldung.jpa.IdGeneration.User</class>
104-
<exclude-unlisted-classes>true</exclude-unlisted-classes>
105-
<properties>
106-
<property name="jakarta.persistence.jdbc.driver" value="org.h2.Driver"/>
107-
<property name="jakarta.persistence.jdbc.url" value="jdbc:h2:mem:idGen"/>
108-
<property name="jakarta.persistence.jdbc.user" value="sa"/>
109-
<property name="jakarta.persistence.jdbc.password" value=""/>
110-
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
111-
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
112-
<property name="hibernate.format_sql" value="true"/>
113-
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false"/>
114-
</properties>
115-
</persistence-unit>
116101
<persistence-unit name="jpa-unique-constraints">
117102
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
118103
<class>com.baeldung.jpa.uniqueconstraints.Person</class>

persistence-modules/java-jpa/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ This module contains articles about the Java Persistence API (JPA) in Java.
1212
- More articles: [[next -->]](/persistence-modules/java-jpa-2)
1313
- [JPA Query Parameters Usage](https://www.baeldung.com/jpa-query-parameters)
1414
- [Default Column Values in JPA](https://www.baeldung.com/jpa-default-column-values)
15+
- [Returning an Auto-Generated Id with JPA](https://www.baeldung.com/jpa-get-auto-generated-id)

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,23 @@
8686
<property name="show_sql" value="true" />
8787
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false" />
8888
</properties>
89+
8990
</persistence-unit>
91+
92+
<persistence-unit name="jpa-h2-id-generation">
93+
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
94+
<class>com.baeldung.jpa.IdGeneration.User</class>
95+
<exclude-unlisted-classes>true</exclude-unlisted-classes>
96+
<properties>
97+
<property name="jakarta.persistence.jdbc.driver" value="org.h2.Driver"/>
98+
<property name="jakarta.persistence.jdbc.url" value="jdbc:h2:mem:idGen"/>
99+
<property name="jakarta.persistence.jdbc.user" value="sa"/>
100+
<property name="jakarta.persistence.jdbc.password" value=""/>
101+
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
102+
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
103+
<property name="hibernate.format_sql" value="true"/>
104+
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false"/>
105+
</properties>
106+
</persistence-unit>
90107

91108
</persistence>

0 commit comments

Comments
 (0)