Skip to content

Commit e9bf523

Browse files
committed
clean up some obsolete code in AbstractEntityPersister
1 parent d81b284 commit e9bf523

File tree

9 files changed

+6
-107
lines changed

9 files changed

+6
-107
lines changed

hibernate-core/src/main/java/org/hibernate/persister/entity/AbstractEntityPersister.java

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@
4040
import org.hibernate.MappingException;
4141
import org.hibernate.PropertyValueException;
4242
import org.hibernate.QueryException;
43-
import org.hibernate.StaleObjectStateException;
44-
import org.hibernate.StaleStateException;
4543
import org.hibernate.annotations.CacheLayout;
4644
import org.hibernate.boot.Metadata;
4745
import org.hibernate.boot.model.internal.SoftDeleteHelper;
@@ -120,7 +118,6 @@
120118
import org.hibernate.internal.util.collections.ArrayHelper;
121119
import org.hibernate.internal.util.collections.LockModeEnumMap;
122120
import org.hibernate.jdbc.Expectation;
123-
import org.hibernate.jdbc.TooManyRowsAffectedException;
124121
import org.hibernate.loader.ast.internal.CacheEntityLoaderHelper;
125122
import org.hibernate.loader.ast.internal.LoaderSelectBuilder;
126123
import org.hibernate.loader.ast.internal.LoaderSqlAstCreationState;
@@ -270,7 +267,6 @@
270267
import org.hibernate.sql.results.graph.entity.internal.EntityResultImpl;
271268
import org.hibernate.sql.results.graph.internal.ImmutableFetchList;
272269
import org.hibernate.sql.results.internal.SqlSelectionImpl;
273-
import org.hibernate.stat.spi.StatisticsImplementor;
274270
import org.hibernate.tuple.NonIdentifierAttribute;
275271
import org.hibernate.tuple.entity.EntityMetamodel;
276272
import org.hibernate.type.AnyType;
@@ -2620,42 +2616,6 @@ protected void initPropertyPaths(Metadata mapping) throws MappingException {
26202616
}
26212617
}
26222618

2623-
protected boolean check(
2624-
int rows,
2625-
Object id,
2626-
int tableNumber,
2627-
Expectation expectation,
2628-
PreparedStatement statement,
2629-
String statementSQL) throws HibernateException {
2630-
try {
2631-
expectation.verifyOutcome( rows, statement, -1, statementSQL );
2632-
}
2633-
catch ( StaleStateException e ) {
2634-
if ( !isNullableTable( tableNumber ) ) {
2635-
final StatisticsImplementor statistics = getFactory().getStatistics();
2636-
if ( statistics.isStatisticsEnabled() ) {
2637-
statistics.optimisticFailure( getEntityName() );
2638-
}
2639-
throw new StaleObjectStateException( getEntityName(), id, e );
2640-
}
2641-
return false;
2642-
}
2643-
catch ( TooManyRowsAffectedException e ) {
2644-
throw new HibernateException(
2645-
"Duplicate identifier in table for: " +
2646-
infoString( this, id, getFactory() )
2647-
);
2648-
}
2649-
catch ( Throwable t ) {
2650-
return false;
2651-
}
2652-
return true;
2653-
}
2654-
2655-
public final boolean checkVersion(final boolean[] includeProperty) {
2656-
return includeProperty[getVersionProperty()] || isVersionGeneratedOnExecution();
2657-
}
2658-
26592619
@Override
26602620
public String getIdentitySelectString() {
26612621
return identitySelectString;
@@ -2757,28 +2717,6 @@ public ModelPart getIdentifierDescriptor() {
27572717
return identifierMapping;
27582718
}
27592719

2760-
@Override
2761-
public boolean hasSkippableTables() {
2762-
return false;
2763-
}
2764-
2765-
protected boolean hasAnySkippableTables(boolean[] optionalTables, boolean[] inverseTables) {
2766-
// todo (6.x) : cache this?
2767-
for ( int i = 0; i < optionalTables.length; i++ ) {
2768-
if ( optionalTables[i] ) {
2769-
return true;
2770-
}
2771-
}
2772-
2773-
for ( int i = 0; i < inverseTables.length; i++ ) {
2774-
if ( inverseTables[i] ) {
2775-
return true;
2776-
}
2777-
}
2778-
2779-
return false;
2780-
}
2781-
27822720
protected void logStaticSQL() {
27832721
if ( LOG.isDebugEnabled() ) {
27842722
LOG.debugf( "Static SQL for entity: %s", getEntityName() );

hibernate-core/src/main/java/org/hibernate/persister/entity/JoinedSubclassEntityPersister.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -696,12 +696,6 @@ protected boolean isIdentifierTable(String tableExpression) {
696696
return tableExpression.equals( getRootTableName() );
697697
}
698698

699-
@Override
700-
public boolean hasSkippableTables() {
701-
// todo (6.x) : cache this?
702-
return hasAnySkippableTables( isNullableTable, isInverseTable );
703-
}
704-
705699
@Override
706700
public boolean isInverseTable(int j) {
707701
return isInverseTable[j];

hibernate-core/src/main/java/org/hibernate/persister/entity/SingleTableEntityPersister.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -535,12 +535,6 @@ protected boolean isIdentifierTable(String tableExpression) {
535535
return tableExpression.equals( getRootTableName() );
536536
}
537537

538-
@Override
539-
public boolean hasSkippableTables() {
540-
// todo (6.x) : cache this?
541-
return hasAnySkippableTables( isNullableTable, isInverseTable );
542-
}
543-
544538
@Override
545539
protected boolean isNullableSubclassTable(int j) {
546540
return isNullableSubclassTable[j];

hibernate-core/src/main/java/org/hibernate/persister/entity/mutation/EntityMutationTarget.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,6 @@ public interface EntityMutationTarget extends MutationTarget<EntityTableMapping>
5050
*/
5151
String getAttributeMutationTableName(int i);
5252

53-
/**
54-
* Whether this target defines any potentially skippable tables.
55-
* <p>
56-
* A table is considered potentially skippable if it is defined
57-
* as inverse or as optional.
58-
*
59-
* @see org.hibernate.annotations.SecondaryRow#owned
60-
* @see org.hibernate.annotations.SecondaryRow#optional
61-
*
62-
* @deprecated No longer called
63-
*/
64-
@Deprecated(since = "7.0", forRemoval = true)
65-
boolean hasSkippableTables();
66-
6753
/**
6854
* The delegate for executing inserts against the root table for
6955
* targets defined using post-insert id generation

hibernate-core/src/test/java/org/hibernate/orm/test/cfg/persister/GoofyPersisterClassProvider.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -848,11 +848,6 @@ public ModelPart getIdentifierDescriptor() {
848848
return null;
849849
}
850850

851-
@Override
852-
public boolean hasSkippableTables() {
853-
return false;
854-
}
855-
856851
@Override
857852
public GeneratedValuesMutationDelegate getInsertDelegate() {
858853
return null;

hibernate-core/src/test/java/org/hibernate/orm/test/inheritance/InheritanceJunctionExistsPredicateTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/*
2-
* Hibernate, Relational Persistence for Idiomatic Java
3-
*
4-
* License: GNU Lesser General Public License (LGPL), version 2.1 or later
5-
* See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html
2+
* SPDX-License-Identifier: LGPL-2.1-or-later
3+
* Copyright Red Hat Inc. and Hibernate Authors
64
*/
75
package org.hibernate.orm.test.inheritance;
86

hibernate-core/src/test/java/org/hibernate/orm/test/jpa/ejb3configuration/PersisterClassProviderTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -879,11 +879,6 @@ public ModelPart getIdentifierDescriptor() {
879879
return null;
880880
}
881881

882-
@Override
883-
public boolean hasSkippableTables() {
884-
return false;
885-
}
886-
887882
@Override
888883
public GeneratedValuesMutationDelegate getInsertDelegate() {
889884
return null;

hibernate-core/src/test/java/org/hibernate/orm/test/legacy/CustomPersister.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -987,11 +987,6 @@ public ModelPart getIdentifierDescriptor() {
987987
return null;
988988
}
989989

990-
@Override
991-
public boolean hasSkippableTables() {
992-
return false;
993-
}
994-
995990
@Override
996991
public GeneratedValuesMutationDelegate getInsertDelegate() {
997992
return null;

hibernate-core/src/test/java/org/hibernate/orm/test/query/hql/instantiation/MatchingConstructorTest.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/*
2+
* SPDX-License-Identifier: LGPL-2.1-or-later
3+
* Copyright Red Hat Inc. and Hibernate Authors
4+
*/
15
package org.hibernate.orm.test.query.hql.instantiation;
26

37
import org.hibernate.annotations.Imported;

0 commit comments

Comments
 (0)