Skip to content

Commit 6d70b50

Browse files
committed
JAVA-41259 Moved code of article jpa-default-column-values from java-jpa-2 to java-jpa
1 parent e796dad commit 6d70b50

File tree

11 files changed

+36
-35
lines changed

11 files changed

+36
-35
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ This module contains articles about the Java Persistence API (JPA) in Java.
55
### Relevant Articles
66

77
- [Mapping Entity Class Names to SQL Table Names with JPA](https://www.baeldung.com/jpa-entity-table-names)
8-
- [Default Column Values in JPA](https://www.baeldung.com/jpa-default-column-values)
98
- [Types of JPA Queries](https://www.baeldung.com/jpa-queries)
109
- [JPA/Hibernate Projections](https://www.baeldung.com/jpa-hibernate-projections)
1110
- [Combining JPA And/Or Criteria Predicates](https://www.baeldung.com/jpa-and-or-criteria-predicates)

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,6 @@
3939
</properties>
4040
</persistence-unit>
4141

42-
<persistence-unit name="entity-default-values">
43-
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
44-
<class>com.baeldung.jpa.defaultvalues.User</class>
45-
<class>com.baeldung.jpa.defaultvalues.UserEntity</class>
46-
<exclude-unlisted-classes>true</exclude-unlisted-classes>
47-
<properties>
48-
<property name="jakarta.persistence.jdbc.driver" value="org.h2.Driver" />
49-
<property name="jakarta.persistence.jdbc.url" value="jdbc:h2:mem:test" />
50-
<property name="jakarta.persistence.jdbc.user" value="sa" />
51-
<property name="jakarta.persistence.jdbc.password" value="" />
52-
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
53-
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
54-
<property name="show_sql" value="true" />
55-
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false" />
56-
</properties>
57-
</persistence-unit>
58-
5942
<persistence-unit name="jpa-query-types">
6043
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
6144
<class>com.baeldung.jpa.querytypes.UserEntity</class>

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

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,6 @@
2121
</properties>
2222
</persistence-unit>
2323

24-
<persistence-unit name="entity-default-values">
25-
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
26-
<class>com.baeldung.jpa.defaultvalues.User</class>
27-
<class>com.baeldung.jpa.defaultvalues.UserEntity</class>
28-
<exclude-unlisted-classes>true</exclude-unlisted-classes>
29-
<properties>
30-
<property name="jakarta.persistence.jdbc.driver" value="org.h2.Driver" />
31-
<property name="jakarta.persistence.jdbc.url" value="jdbc:h2:mem:test" />
32-
<property name="jakarta.persistence.jdbc.user" value="sa" />
33-
<property name="jakarta.persistence.jdbc.password" value="" />
34-
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
35-
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
36-
<property name="show_sql" value="false" />
37-
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false" />
38-
</properties>
39-
</persistence-unit>
40-
4124
<persistence-unit name="jpa-query-types">
4225
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
4326
<class>com.baeldung.jpa.querytypes.UserEntity</class>

persistence-modules/java-jpa/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ This module contains articles about the Java Persistence API (JPA) in Java.
1111
- [Persisting Enums in JPA](https://www.baeldung.com/jpa-persisting-enums-in-jpa)
1212
- More articles: [[next -->]](/persistence-modules/java-jpa-2)
1313
- [JPA Query Parameters Usage](https://www.baeldung.com/jpa-query-parameters)
14+
- [Default Column Values in JPA](https://www.baeldung.com/jpa-default-column-values)

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
@@ -70,5 +70,22 @@
7070
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false" />
7171
</properties>
7272
</persistence-unit>
73+
74+
<persistence-unit name="entity-default-values">
75+
<provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
76+
<class>com.baeldung.jpa.defaultvalues.User</class>
77+
<class>com.baeldung.jpa.defaultvalues.UserEntity</class>
78+
<exclude-unlisted-classes>true</exclude-unlisted-classes>
79+
<properties>
80+
<property name="jakarta.persistence.jdbc.driver" value="org.h2.Driver" />
81+
<property name="jakarta.persistence.jdbc.url" value="jdbc:h2:mem:test" />
82+
<property name="jakarta.persistence.jdbc.user" value="sa" />
83+
<property name="jakarta.persistence.jdbc.password" value="" />
84+
<property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
85+
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
86+
<property name="show_sql" value="true" />
87+
<property name="hibernate.temp.use_jdbc_metadata_defaults" value="false" />
88+
</properties>
89+
</persistence-unit>
7390

7491
</persistence>

0 commit comments

Comments
 (0)