Skip to content

Commit 8eb7d54

Browse files
jrenaatsebersole
authored andcommitted
HHH-18443 - Drop SessionFactoryBuilder#enableJpaListCompliance
Signed-off-by: Jan Schatteman <[email protected]>
1 parent dcc9f66 commit 8eb7d54

File tree

13 files changed

+1
-126
lines changed

13 files changed

+1
-126
lines changed

hibernate-core/src/main/java/org/hibernate/boot/SessionFactoryBuilder.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -709,16 +709,6 @@ public interface SessionFactoryBuilder {
709709
*/
710710
SessionFactoryBuilder enableJpaTransactionCompliance(boolean enabled);
711711

712-
/**
713-
* @see JpaCompliance#isJpaListComplianceEnabled()
714-
*
715-
* @see org.hibernate.cfg.AvailableSettings#JPA_LIST_COMPLIANCE
716-
*
717-
* @deprecated Use {@link org.hibernate.cfg.AvailableSettings#DEFAULT_LIST_SEMANTICS} instead
718-
*/
719-
@Deprecated( since = "6.0" )
720-
SessionFactoryBuilder enableJpaListCompliance(boolean enabled);
721-
722712
/**
723713
* @deprecated No longer has any effect.
724714
*

hibernate-core/src/main/java/org/hibernate/boot/internal/SessionFactoryBuilderImpl.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,6 @@ public SessionFactoryBuilder enableJpaTransactionCompliance(boolean enabled) {
404404
return this;
405405
}
406406

407-
@Override
408-
public SessionFactoryBuilder enableJpaListCompliance(boolean enabled) {
409-
this.optionsBuilder.enableJpaListCompliance( enabled );
410-
return this;
411-
}
412-
413407
@Override
414408
public SessionFactoryBuilder enableJpaCascadeCompliance(boolean enabled) {
415409
this.optionsBuilder.enableJpaCascadeCompliance( enabled );

hibernate-core/src/main/java/org/hibernate/boot/internal/SessionFactoryOptionsBuilder.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,10 +1574,6 @@ public void enableJpaTransactionCompliance(boolean enabled) {
15741574
mutableJpaCompliance().setTransactionCompliance( enabled );
15751575
}
15761576

1577-
public void enableJpaListCompliance(boolean enabled) {
1578-
mutableJpaCompliance().setListCompliance( enabled );
1579-
}
1580-
15811577
public void enableJpaCascadeCompliance(boolean enabled) {
15821578
mutableJpaCompliance().setCascadeCompliance( enabled );
15831579
}

hibernate-core/src/main/java/org/hibernate/boot/spi/AbstractDelegatingSessionFactoryBuilder.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,6 @@ public T enableJpaCascadeCompliance(boolean enabled) {
374374
return getThis();
375375
}
376376

377-
@Override
378-
public T enableJpaListCompliance(boolean enabled) {
379-
delegate.enableJpaListCompliance( enabled );
380-
return getThis();
381-
}
382-
383377
@Override
384378
public T enableJpaClosedCompliance(boolean enabled) {
385379
delegate.enableJpaClosedCompliance( enabled );

hibernate-core/src/main/java/org/hibernate/cfg/JpaComplianceSettings.java

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public interface JpaComplianceSettings {
1919
*
2020
* @see #JPA_TRANSACTION_COMPLIANCE
2121
* @see #JPA_QUERY_COMPLIANCE
22-
* @see #JPA_LIST_COMPLIANCE
2322
* @see #JPA_ORDER_BY_MAPPING_COMPLIANCE
2423
* @see #JPA_CLOSED_COMPLIANCE
2524
* @see #JPA_PROXY_COMPLIANCE
@@ -69,33 +68,6 @@ public interface JpaComplianceSettings {
6968
@Deprecated
7069
String JPA_CASCADE_COMPLIANCE = "hibernate.jpa.compliance.cascade";
7170

72-
/**
73-
* Controls whether Hibernate should treat what it would usually consider a
74-
* {@linkplain org.hibernate.collection.spi.PersistentBag "bag"}, that is, a
75-
* list with no index column, whose element order is not persistent, as a true
76-
* {@link org.hibernate.collection.spi.PersistentList list} with an index column
77-
* and a persistent element order.
78-
*
79-
* @apiNote If enabled, Hibernate will recognize it as a list where the
80-
* {@link jakarta.persistence.OrderColumn} annotation is simply missing
81-
* (and its defaults will apply).
82-
*
83-
* @settingDefault {@link #JPA_COMPLIANCE}
84-
*
85-
* @see org.hibernate.jpa.spi.JpaCompliance#isJpaListComplianceEnabled()
86-
* @see org.hibernate.boot.SessionFactoryBuilder#enableJpaListCompliance(boolean)
87-
*
88-
* @since 5.3
89-
*
90-
* @deprecated Use {@link MappingSettings#DEFAULT_LIST_SEMANTICS} instead. The specification
91-
* actually leaves this behavior undefined, saying that portable applications
92-
* should not rely on any specific behavior for a {@link java.util.List} with
93-
* no {@code @OrderColumn}.
94-
*/
95-
@Deprecated( since = "6.0" )
96-
@SuppressWarnings("DeprecatedIsStillUsed")
97-
String JPA_LIST_COMPLIANCE = "hibernate.jpa.compliance.list";
98-
9971
/**
10072
* JPA specifies that items occurring in {@link jakarta.persistence.OrderBy}
10173
* lists must be references to entity attributes, whereas Hibernate, by default,

hibernate-core/src/main/java/org/hibernate/jpa/internal/JpaComplianceImpl.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
* @author Andrea Boriero
1313
*/
1414
public class JpaComplianceImpl implements JpaCompliance {
15-
private final boolean listCompliance;
1615
private final boolean orderByMappingCompliance;
1716
private final boolean proxyCompliance;
1817
private final boolean globalGeneratorNameScopeCompliance;
@@ -24,7 +23,6 @@ public class JpaComplianceImpl implements JpaCompliance {
2423
private final boolean cascadeCompliance;
2524

2625
public JpaComplianceImpl(
27-
boolean listCompliance,
2826
boolean orderByMappingCompliance,
2927
boolean proxyCompliance,
3028
boolean globalGeneratorNameScopeCompliance,
@@ -36,7 +34,6 @@ public JpaComplianceImpl(
3634
boolean cascadeCompliance) {
3735
this.queryCompliance = queryCompliance;
3836
this.transactionCompliance = transactionCompliance;
39-
this.listCompliance = listCompliance;
4037
this.closedCompliance = closedCompliance;
4138
this.proxyCompliance = proxyCompliance;
4239
this.cachingCompliance = cachingCompliance;
@@ -61,11 +58,6 @@ public boolean isJpaCascadeComplianceEnabled() {
6158
return cascadeCompliance;
6259
}
6360

64-
@Override
65-
public boolean isJpaListComplianceEnabled() {
66-
return listCompliance;
67-
}
68-
6961
@Override
7062
public boolean isJpaClosedComplianceEnabled() {
7163
return closedCompliance;
@@ -98,7 +90,6 @@ public boolean isLoadByIdComplianceEnabled() {
9890

9991
public static class JpaComplianceBuilder {
10092
private boolean queryCompliance;
101-
private boolean listCompliance;
10293
private boolean orderByMappingCompliance;
10394
private boolean proxyCompliance;
10495
private boolean globalGeneratorNameScopeCompliance;
@@ -116,11 +107,6 @@ public JpaComplianceBuilder setCascadeCompliance(boolean cascadeCompliance) {
116107
return this;
117108
}
118109

119-
public JpaComplianceBuilder setListCompliance(boolean listCompliance) {
120-
this.listCompliance = listCompliance;
121-
return this;
122-
}
123-
124110
public JpaComplianceBuilder setOrderByMappingCompliance(boolean orderByMappingCompliance) {
125111
this.orderByMappingCompliance = orderByMappingCompliance;
126112
return this;
@@ -163,7 +149,6 @@ public JpaComplianceBuilder setLoadByIdCompliance(boolean loadByIdCompliance) {
163149

164150
JpaCompliance createJpaCompliance() {
165151
return new JpaComplianceImpl(
166-
listCompliance,
167152
orderByMappingCompliance,
168153
proxyCompliance,
169154
globalGeneratorNameScopeCompliance,

hibernate-core/src/main/java/org/hibernate/jpa/internal/MutableJpaComplianceImpl.java

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
* @author Steve Ebersole
1818
*/
1919
public class MutableJpaComplianceImpl implements MutableJpaCompliance {
20-
private boolean listCompliance;
2120
private boolean orderByMappingCompliance;
2221
private boolean proxyCompliance;
2322
private boolean generatorNameScopeCompliance;
@@ -38,12 +37,6 @@ public MutableJpaComplianceImpl(Map<?,?> configurationSettings) {
3837
public MutableJpaComplianceImpl(Map<?,?> configurationSettings, boolean jpaByDefault) {
3938
final Object legacyQueryCompliance = configurationSettings.get( AvailableSettings.JPAQL_STRICT_COMPLIANCE );
4039

41-
//noinspection deprecation
42-
listCompliance = ConfigurationHelper.getBoolean(
43-
AvailableSettings.JPA_LIST_COMPLIANCE,
44-
configurationSettings,
45-
jpaByDefault
46-
);
4740
proxyCompliance = ConfigurationHelper.getBoolean(
4841
AvailableSettings.JPA_PROXY_COMPLIANCE,
4942
configurationSettings,
@@ -100,11 +93,6 @@ public boolean isJpaCascadeComplianceEnabled() {
10093
return true;
10194
}
10295

103-
@Override
104-
public boolean isJpaListComplianceEnabled() {
105-
return listCompliance;
106-
}
107-
10896
@Override
10997
public boolean isJpaClosedComplianceEnabled() {
11098
return closedCompliance;
@@ -138,11 +126,6 @@ public boolean isLoadByIdComplianceEnabled() {
138126
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
139127
// Mutators
140128

141-
@Override
142-
public void setListCompliance(boolean listCompliance) {
143-
this.listCompliance = listCompliance;
144-
}
145-
146129
@Override
147130
public void setCascadeCompliance(boolean cascadeCompliance) {
148131
}
@@ -189,8 +172,7 @@ public void setLoadByIdCompliance(boolean enabled) {
189172
@Override
190173
public JpaCompliance immutableCopy() {
191174
JpaComplianceImpl.JpaComplianceBuilder builder = new JpaComplianceImpl.JpaComplianceBuilder();
192-
builder = builder.setListCompliance( listCompliance )
193-
.setProxyCompliance( proxyCompliance )
175+
builder = builder.setProxyCompliance( proxyCompliance )
194176
.setOrderByMappingCompliance( orderByMappingCompliance )
195177
.setGlobalGeneratorNameCompliance( generatorNameScopeCompliance )
196178
.setQueryCompliance( queryCompliance )

hibernate-core/src/main/java/org/hibernate/jpa/spi/JpaCompliance.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,6 @@ public interface JpaCompliance {
4242
*/
4343
boolean isJpaTransactionComplianceEnabled();
4444

45-
/**
46-
* Controls how Hibernate interprets a mapped {@link java.util.List}
47-
* without no {@linkplain jakarta.persistence.OrderColumn order column}
48-
* specified. Historically Hibernate treats this as a "bag", which is a
49-
* concept JPA does not have.
50-
* <ul>
51-
* <li>If enabled, Hibernate will recognize this case as a
52-
* {@linkplain org.hibernate.collection.spi.PersistentList list}.
53-
* <li>Otherwise, if disabled, Hibernate will treat it as a
54-
* {@linkplain org.hibernate.collection.spi.PersistentBag "bag"}.
55-
* </ul>
56-
*
57-
* @return {@code true} indicates to behave in the spec-defined way,
58-
* interpreting the mapping as a "list", rather than a "bag"
59-
*
60-
* @see org.hibernate.cfg.AvailableSettings#JPA_LIST_COMPLIANCE
61-
*
62-
* @deprecated Use {@link org.hibernate.cfg.AvailableSettings#DEFAULT_LIST_SEMANTICS} instead
63-
*/
64-
@Deprecated( since = "6.0" )
65-
boolean isJpaListComplianceEnabled();
66-
6745
/**
6846
* JPA defines specific exceptions on specific methods when called on
6947
* {@link jakarta.persistence.EntityManager} and

hibernate-core/src/main/java/org/hibernate/jpa/spi/MutableJpaCompliance.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ public interface MutableJpaCompliance extends JpaCompliance {
1616
@Deprecated
1717
void setCascadeCompliance(boolean cascadeCompliance);
1818

19-
void setListCompliance(boolean listCompliance);
20-
2119
void setOrderByMappingCompliance(boolean orderByCompliance);
2220

2321
void setProxyCompliance(boolean proxyCompliance);

hibernate-core/src/test/java/org/hibernate/orm/test/jpa/JpaComplianceStub.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ public boolean isJpaCascadeComplianceEnabled() {
2929
return false;
3030
}
3131

32-
@Override
33-
public boolean isJpaListComplianceEnabled() {
34-
return false;
35-
}
36-
3732
@Override
3833
public boolean isJpaClosedComplianceEnabled() {
3934
return false;

0 commit comments

Comments
 (0)