HHH-18443 - Drop SessionFactoryBuilder#enableJpaListCompliance
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
parent
dcc9f66d78
commit
8eb7d5457e
|
@ -709,16 +709,6 @@ public interface SessionFactoryBuilder {
|
|||
*/
|
||||
SessionFactoryBuilder enableJpaTransactionCompliance(boolean enabled);
|
||||
|
||||
/**
|
||||
* @see JpaCompliance#isJpaListComplianceEnabled()
|
||||
*
|
||||
* @see org.hibernate.cfg.AvailableSettings#JPA_LIST_COMPLIANCE
|
||||
*
|
||||
* @deprecated Use {@link org.hibernate.cfg.AvailableSettings#DEFAULT_LIST_SEMANTICS} instead
|
||||
*/
|
||||
@Deprecated( since = "6.0" )
|
||||
SessionFactoryBuilder enableJpaListCompliance(boolean enabled);
|
||||
|
||||
/**
|
||||
* @deprecated No longer has any effect.
|
||||
*
|
||||
|
|
|
@ -404,12 +404,6 @@ public class SessionFactoryBuilderImpl implements SessionFactoryBuilderImplement
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SessionFactoryBuilder enableJpaListCompliance(boolean enabled) {
|
||||
this.optionsBuilder.enableJpaListCompliance( enabled );
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SessionFactoryBuilder enableJpaCascadeCompliance(boolean enabled) {
|
||||
this.optionsBuilder.enableJpaCascadeCompliance( enabled );
|
||||
|
|
|
@ -1574,10 +1574,6 @@ public class SessionFactoryOptionsBuilder implements SessionFactoryOptions {
|
|||
mutableJpaCompliance().setTransactionCompliance( enabled );
|
||||
}
|
||||
|
||||
public void enableJpaListCompliance(boolean enabled) {
|
||||
mutableJpaCompliance().setListCompliance( enabled );
|
||||
}
|
||||
|
||||
public void enableJpaCascadeCompliance(boolean enabled) {
|
||||
mutableJpaCompliance().setCascadeCompliance( enabled );
|
||||
}
|
||||
|
|
|
@ -374,12 +374,6 @@ public abstract class AbstractDelegatingSessionFactoryBuilder<T extends SessionF
|
|||
return getThis();
|
||||
}
|
||||
|
||||
@Override
|
||||
public T enableJpaListCompliance(boolean enabled) {
|
||||
delegate.enableJpaListCompliance( enabled );
|
||||
return getThis();
|
||||
}
|
||||
|
||||
@Override
|
||||
public T enableJpaClosedCompliance(boolean enabled) {
|
||||
delegate.enableJpaClosedCompliance( enabled );
|
||||
|
|
|
@ -19,7 +19,6 @@ public interface JpaComplianceSettings {
|
|||
*
|
||||
* @see #JPA_TRANSACTION_COMPLIANCE
|
||||
* @see #JPA_QUERY_COMPLIANCE
|
||||
* @see #JPA_LIST_COMPLIANCE
|
||||
* @see #JPA_ORDER_BY_MAPPING_COMPLIANCE
|
||||
* @see #JPA_CLOSED_COMPLIANCE
|
||||
* @see #JPA_PROXY_COMPLIANCE
|
||||
|
@ -69,33 +68,6 @@ public interface JpaComplianceSettings {
|
|||
@Deprecated
|
||||
String JPA_CASCADE_COMPLIANCE = "hibernate.jpa.compliance.cascade";
|
||||
|
||||
/**
|
||||
* Controls whether Hibernate should treat what it would usually consider a
|
||||
* {@linkplain org.hibernate.collection.spi.PersistentBag "bag"}, that is, a
|
||||
* list with no index column, whose element order is not persistent, as a true
|
||||
* {@link org.hibernate.collection.spi.PersistentList list} with an index column
|
||||
* and a persistent element order.
|
||||
*
|
||||
* @apiNote If enabled, Hibernate will recognize it as a list where the
|
||||
* {@link jakarta.persistence.OrderColumn} annotation is simply missing
|
||||
* (and its defaults will apply).
|
||||
*
|
||||
* @settingDefault {@link #JPA_COMPLIANCE}
|
||||
*
|
||||
* @see org.hibernate.jpa.spi.JpaCompliance#isJpaListComplianceEnabled()
|
||||
* @see org.hibernate.boot.SessionFactoryBuilder#enableJpaListCompliance(boolean)
|
||||
*
|
||||
* @since 5.3
|
||||
*
|
||||
* @deprecated Use {@link MappingSettings#DEFAULT_LIST_SEMANTICS} instead. The specification
|
||||
* actually leaves this behavior undefined, saying that portable applications
|
||||
* should not rely on any specific behavior for a {@link java.util.List} with
|
||||
* no {@code @OrderColumn}.
|
||||
*/
|
||||
@Deprecated( since = "6.0" )
|
||||
@SuppressWarnings("DeprecatedIsStillUsed")
|
||||
String JPA_LIST_COMPLIANCE = "hibernate.jpa.compliance.list";
|
||||
|
||||
/**
|
||||
* JPA specifies that items occurring in {@link jakarta.persistence.OrderBy}
|
||||
* lists must be references to entity attributes, whereas Hibernate, by default,
|
||||
|
|
|
@ -12,7 +12,6 @@ import org.hibernate.jpa.spi.JpaCompliance;
|
|||
* @author Andrea Boriero
|
||||
*/
|
||||
public class JpaComplianceImpl implements JpaCompliance {
|
||||
private final boolean listCompliance;
|
||||
private final boolean orderByMappingCompliance;
|
||||
private final boolean proxyCompliance;
|
||||
private final boolean globalGeneratorNameScopeCompliance;
|
||||
|
@ -24,7 +23,6 @@ public class JpaComplianceImpl implements JpaCompliance {
|
|||
private final boolean cascadeCompliance;
|
||||
|
||||
public JpaComplianceImpl(
|
||||
boolean listCompliance,
|
||||
boolean orderByMappingCompliance,
|
||||
boolean proxyCompliance,
|
||||
boolean globalGeneratorNameScopeCompliance,
|
||||
|
@ -36,7 +34,6 @@ public class JpaComplianceImpl implements JpaCompliance {
|
|||
boolean cascadeCompliance) {
|
||||
this.queryCompliance = queryCompliance;
|
||||
this.transactionCompliance = transactionCompliance;
|
||||
this.listCompliance = listCompliance;
|
||||
this.closedCompliance = closedCompliance;
|
||||
this.proxyCompliance = proxyCompliance;
|
||||
this.cachingCompliance = cachingCompliance;
|
||||
|
@ -61,11 +58,6 @@ public class JpaComplianceImpl implements JpaCompliance {
|
|||
return cascadeCompliance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isJpaListComplianceEnabled() {
|
||||
return listCompliance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isJpaClosedComplianceEnabled() {
|
||||
return closedCompliance;
|
||||
|
@ -98,7 +90,6 @@ public class JpaComplianceImpl implements JpaCompliance {
|
|||
|
||||
public static class JpaComplianceBuilder {
|
||||
private boolean queryCompliance;
|
||||
private boolean listCompliance;
|
||||
private boolean orderByMappingCompliance;
|
||||
private boolean proxyCompliance;
|
||||
private boolean globalGeneratorNameScopeCompliance;
|
||||
|
@ -116,11 +107,6 @@ public class JpaComplianceImpl implements JpaCompliance {
|
|||
return this;
|
||||
}
|
||||
|
||||
public JpaComplianceBuilder setListCompliance(boolean listCompliance) {
|
||||
this.listCompliance = listCompliance;
|
||||
return this;
|
||||
}
|
||||
|
||||
public JpaComplianceBuilder setOrderByMappingCompliance(boolean orderByMappingCompliance) {
|
||||
this.orderByMappingCompliance = orderByMappingCompliance;
|
||||
return this;
|
||||
|
@ -163,7 +149,6 @@ public class JpaComplianceImpl implements JpaCompliance {
|
|||
|
||||
JpaCompliance createJpaCompliance() {
|
||||
return new JpaComplianceImpl(
|
||||
listCompliance,
|
||||
orderByMappingCompliance,
|
||||
proxyCompliance,
|
||||
globalGeneratorNameScopeCompliance,
|
||||
|
|
|
@ -17,7 +17,6 @@ import org.hibernate.jpa.spi.MutableJpaCompliance;
|
|||
* @author Steve Ebersole
|
||||
*/
|
||||
public class MutableJpaComplianceImpl implements MutableJpaCompliance {
|
||||
private boolean listCompliance;
|
||||
private boolean orderByMappingCompliance;
|
||||
private boolean proxyCompliance;
|
||||
private boolean generatorNameScopeCompliance;
|
||||
|
@ -38,12 +37,6 @@ public class MutableJpaComplianceImpl implements MutableJpaCompliance {
|
|||
public MutableJpaComplianceImpl(Map<?,?> configurationSettings, boolean jpaByDefault) {
|
||||
final Object legacyQueryCompliance = configurationSettings.get( AvailableSettings.JPAQL_STRICT_COMPLIANCE );
|
||||
|
||||
//noinspection deprecation
|
||||
listCompliance = ConfigurationHelper.getBoolean(
|
||||
AvailableSettings.JPA_LIST_COMPLIANCE,
|
||||
configurationSettings,
|
||||
jpaByDefault
|
||||
);
|
||||
proxyCompliance = ConfigurationHelper.getBoolean(
|
||||
AvailableSettings.JPA_PROXY_COMPLIANCE,
|
||||
configurationSettings,
|
||||
|
@ -100,11 +93,6 @@ public class MutableJpaComplianceImpl implements MutableJpaCompliance {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isJpaListComplianceEnabled() {
|
||||
return listCompliance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isJpaClosedComplianceEnabled() {
|
||||
return closedCompliance;
|
||||
|
@ -138,11 +126,6 @@ public class MutableJpaComplianceImpl implements MutableJpaCompliance {
|
|||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Mutators
|
||||
|
||||
@Override
|
||||
public void setListCompliance(boolean listCompliance) {
|
||||
this.listCompliance = listCompliance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCascadeCompliance(boolean cascadeCompliance) {
|
||||
}
|
||||
|
@ -189,8 +172,7 @@ public class MutableJpaComplianceImpl implements MutableJpaCompliance {
|
|||
@Override
|
||||
public JpaCompliance immutableCopy() {
|
||||
JpaComplianceImpl.JpaComplianceBuilder builder = new JpaComplianceImpl.JpaComplianceBuilder();
|
||||
builder = builder.setListCompliance( listCompliance )
|
||||
.setProxyCompliance( proxyCompliance )
|
||||
builder = builder.setProxyCompliance( proxyCompliance )
|
||||
.setOrderByMappingCompliance( orderByMappingCompliance )
|
||||
.setGlobalGeneratorNameCompliance( generatorNameScopeCompliance )
|
||||
.setQueryCompliance( queryCompliance )
|
||||
|
|
|
@ -42,28 +42,6 @@ public interface JpaCompliance {
|
|||
*/
|
||||
boolean isJpaTransactionComplianceEnabled();
|
||||
|
||||
/**
|
||||
* Controls how Hibernate interprets a mapped {@link java.util.List}
|
||||
* without no {@linkplain jakarta.persistence.OrderColumn order column}
|
||||
* specified. Historically Hibernate treats this as a "bag", which is a
|
||||
* concept JPA does not have.
|
||||
* <ul>
|
||||
* <li>If enabled, Hibernate will recognize this case as a
|
||||
* {@linkplain org.hibernate.collection.spi.PersistentList list}.
|
||||
* <li>Otherwise, if disabled, Hibernate will treat it as a
|
||||
* {@linkplain org.hibernate.collection.spi.PersistentBag "bag"}.
|
||||
* </ul>
|
||||
*
|
||||
* @return {@code true} indicates to behave in the spec-defined way,
|
||||
* interpreting the mapping as a "list", rather than a "bag"
|
||||
*
|
||||
* @see org.hibernate.cfg.AvailableSettings#JPA_LIST_COMPLIANCE
|
||||
*
|
||||
* @deprecated Use {@link org.hibernate.cfg.AvailableSettings#DEFAULT_LIST_SEMANTICS} instead
|
||||
*/
|
||||
@Deprecated( since = "6.0" )
|
||||
boolean isJpaListComplianceEnabled();
|
||||
|
||||
/**
|
||||
* JPA defines specific exceptions on specific methods when called on
|
||||
* {@link jakarta.persistence.EntityManager} and
|
||||
|
|
|
@ -16,8 +16,6 @@ public interface MutableJpaCompliance extends JpaCompliance {
|
|||
@Deprecated
|
||||
void setCascadeCompliance(boolean cascadeCompliance);
|
||||
|
||||
void setListCompliance(boolean listCompliance);
|
||||
|
||||
void setOrderByMappingCompliance(boolean orderByCompliance);
|
||||
|
||||
void setProxyCompliance(boolean proxyCompliance);
|
||||
|
|
|
@ -29,11 +29,6 @@ public class JpaComplianceStub implements JpaCompliance {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isJpaListComplianceEnabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isJpaClosedComplianceEnabled() {
|
||||
return false;
|
||||
|
|
|
@ -48,7 +48,6 @@ public class JpaComplianceTests {
|
|||
assertThat( compliance.isJpaQueryComplianceEnabled() ).isEqualTo( expected );
|
||||
assertThat( compliance.isJpaTransactionComplianceEnabled() ).isEqualTo( expected );
|
||||
assertThat( compliance.isJpaClosedComplianceEnabled() ).isEqualTo( expected );
|
||||
assertThat( compliance.isJpaListComplianceEnabled() ).isEqualTo( expected );
|
||||
assertThat( compliance.isJpaOrderByMappingComplianceEnabled() ).isEqualTo( expected );
|
||||
assertThat( compliance.isJpaProxyComplianceEnabled() ).isEqualTo( expected );
|
||||
assertThat( compliance.isJpaCacheComplianceEnabled() ).isEqualTo( expected );
|
||||
|
@ -78,7 +77,6 @@ public class JpaComplianceTests {
|
|||
assertThat( compliance.isJpaQueryComplianceEnabled() ).isEqualTo( !expected );
|
||||
assertThat( compliance.isJpaTransactionComplianceEnabled() ).isEqualTo( expected );
|
||||
assertThat( compliance.isJpaClosedComplianceEnabled() ).isEqualTo( expected );
|
||||
assertThat( compliance.isJpaListComplianceEnabled() ).isEqualTo( expected );
|
||||
assertThat( compliance.isJpaOrderByMappingComplianceEnabled() ).isEqualTo( expected );
|
||||
assertThat( compliance.isJpaProxyComplianceEnabled() ).isEqualTo( expected );
|
||||
assertThat( compliance.isJpaCacheComplianceEnabled() ).isEqualTo( expected );
|
||||
|
|
|
@ -99,7 +99,6 @@ public class EntityManagerFactoryExtension
|
|||
pui.getProperties().put( AvailableSettings.JPA_COMPLIANCE, emfAnn.jpaComplianceEnabled() );
|
||||
pui.getProperties().put( AvailableSettings.JPA_QUERY_COMPLIANCE, emfAnn.queryComplianceEnabled() );
|
||||
pui.getProperties().put( AvailableSettings.JPA_TRANSACTION_COMPLIANCE, emfAnn.transactionComplianceEnabled() );
|
||||
pui.getProperties().put( AvailableSettings.JPA_LIST_COMPLIANCE, emfAnn.listMappingComplianceEnabled() );
|
||||
pui.getProperties().put( AvailableSettings.JPA_CLOSED_COMPLIANCE, emfAnn.closedComplianceEnabled() );
|
||||
pui.getProperties().put( AvailableSettings.JPA_PROXY_COMPLIANCE, emfAnn.proxyComplianceEnabled() );
|
||||
pui.getProperties().put( AvailableSettings.JPA_CACHING_COMPLIANCE, emfAnn.cacheComplianceEnabled() );
|
||||
|
|
|
@ -83,12 +83,6 @@ public @interface Jpa {
|
|||
*/
|
||||
boolean closedComplianceEnabled() default false;
|
||||
|
||||
/**
|
||||
* @see JpaCompliance#isJpaListComplianceEnabled()
|
||||
* @see org.hibernate.cfg.AvailableSettings#DEFAULT_LIST_SEMANTICS
|
||||
*/
|
||||
boolean listMappingComplianceEnabled() default false;
|
||||
|
||||
/**
|
||||
* @see JpaCompliance#isJpaOrderByMappingComplianceEnabled()
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue