Migrate type from Serializable[] to String[]

This commit is contained in:
Sanne Grinovero 2023-06-01 15:50:11 +01:00 committed by Sanne Grinovero
parent ab0bd8d75d
commit f49535d397
17 changed files with 26 additions and 37 deletions

View File

@ -46,7 +46,7 @@ import org.hibernate.sql.ast.tree.insert.InsertSelectStatement;
*/
public class BulkOperationCleanupAction implements Executable, Serializable {
private final Serializable[] affectedTableSpaces;
private final String[] affectedTableSpaces;
private final Set<EntityCleanup> entityCleanups = new HashSet<>();
private final Set<CollectionCleanup> collectionCleanups = new HashSet<>();
@ -211,7 +211,7 @@ public class BulkOperationCleanupAction implements Executable, Serializable {
}
@Override
public Serializable[] getPropertySpaces() {
public String[] getPropertySpaces() {
return affectedTableSpaces;
}

View File

@ -6,8 +6,6 @@
*/
package org.hibernate.action.internal;
import java.io.Serializable;
import org.hibernate.action.spi.AfterTransactionCompletionProcess;
import org.hibernate.action.spi.BeforeTransactionCompletionProcess;
import org.hibernate.cache.CacheException;
@ -101,7 +99,7 @@ public abstract class CollectionAction implements ComparableExecutable {
}
@Override
public Serializable[] getPropertySpaces() {
public String[] getPropertySpaces() {
return persister.getCollectionSpaces();
}

View File

@ -6,8 +6,6 @@
*/
package org.hibernate.action.internal;
import java.io.Serializable;
import org.hibernate.AssertionFailure;
import org.hibernate.action.spi.AfterTransactionCompletionProcess;
import org.hibernate.action.spi.BeforeTransactionCompletionProcess;
@ -136,7 +134,7 @@ public abstract class EntityAction
}
@Override
public final Serializable[] getPropertySpaces() {
public final String[] getPropertySpaces() {
return persister.getPropertySpaces();
}

View File

@ -6,8 +6,6 @@
*/
package org.hibernate.action.spi;
import java.io.Serializable;
import org.hibernate.HibernateException;
import org.hibernate.event.spi.EventSource;
@ -27,7 +25,7 @@ public interface Executable {
*
* @return The spaces affected by this action.
*/
Serializable[] getPropertySpaces();
String[] getPropertySpaces();
/**
* Called before executing any actions. Gives actions a chance to perform any preparation.

View File

@ -423,7 +423,7 @@ public class ActionQueue {
beforeTransactionProcesses.register( executable.getBeforeTransactionCompletionProcess() );
}
if ( session.getFactory().getSessionFactoryOptions().isQueryCacheEnabled() ) {
invalidateSpaces( (String[]) executable.getPropertySpaces() );
invalidateSpaces( executable.getPropertySpaces() );
}
if ( executable.getAfterTransactionCompletionProcess() != null ) {
if ( afterTransactionProcesses == null ) {

View File

@ -6,7 +6,6 @@
*/
package org.hibernate.persister.collection;
import java.io.Serializable;
import java.util.Comparator;
import java.util.Map;
import java.util.Set;
@ -255,7 +254,7 @@ public interface CollectionPersister extends Restrictable {
/**
* Get the "space" that holds the persistent state
*/
Serializable[] getCollectionSpaces();
String[] getCollectionSpaces();
/**
* Get the user-visible metadata for the collection (optional operation)

View File

@ -210,7 +210,7 @@ public interface EntityPersister extends EntityMappingType, RootTableGroupProduc
*
* @return The property spaces.
*/
Serializable[] getPropertySpaces();
String[] getPropertySpaces();
/**
* Returns an array of objects that identify spaces in which properties of

View File

@ -6,7 +6,6 @@
*/
package org.hibernate.persister.entity;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@ -873,7 +872,7 @@ public class JoinedSubclassEntityPersister extends AbstractEntityPersister {
}
@Override
public Serializable[] getPropertySpaces() {
public String[] getPropertySpaces() {
return spaces; // don't need subclass tables, because they can't appear in conditions
}

View File

@ -6,7 +6,6 @@
*/
package org.hibernate.persister.entity;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -502,7 +501,7 @@ public class SingleTableEntityPersister extends AbstractEntityPersister {
}
@Override
public Serializable[] getPropertySpaces() {
public String[] getPropertySpaces() {
return spaces;
}

View File

@ -341,7 +341,7 @@ public class UnionSubclassEntityPersister extends AbstractEntityPersister {
}
@Override
public Serializable[] getPropertySpaces() {
public String[] getPropertySpaces() {
return spaces;
}

View File

@ -250,8 +250,8 @@ public class GoofyPersisterClassProvider implements PersisterClassResolver {
}
@Override
public Serializable[] getPropertySpaces() {
return new Serializable[0];
public String[] getPropertySpaces() {
return new String[0];
}
@Override
@ -924,8 +924,8 @@ public class GoofyPersisterClassProvider implements PersisterClassResolver {
return false; //To change body of implemented methods use File | Settings | File Templates.
}
public Serializable[] getCollectionSpaces() {
return new Serializable[0]; //To change body of implemented methods use File | Settings | File Templates.
public String[] getCollectionSpaces() {
return new String[0]; //To change body of implemented methods use File | Settings | File Templates.
}
public CollectionMetadata getCollectionMetadata() {

View File

@ -40,7 +40,7 @@ public class NonSortedExecutableListTest {
private static class AnExecutable implements ComparableExecutable {
private final int n;
private final Serializable[] spaces;
private final String[] spaces;
private transient boolean afterDeserializeCalled;
@ -75,7 +75,7 @@ public class NonSortedExecutableListTest {
}
@Override
public Serializable[] getPropertySpaces() {
public String[] getPropertySpaces() {
return spaces;
}

View File

@ -39,7 +39,7 @@ public class SortedExecutableListTest {
private static class AnExecutable implements ComparableExecutable {
private final int n;
private Serializable[] spaces;
private String[] spaces;
private transient boolean afterDeserializeCalled;
public AnExecutable(int n, String... spaces) {
@ -73,7 +73,7 @@ public class SortedExecutableListTest {
}
@Override
public Serializable[] getPropertySpaces() {
public String[] getPropertySpaces() {
return spaces;
}

View File

@ -277,8 +277,8 @@ public class PersisterClassProviderTest {
}
@Override
public Serializable[] getPropertySpaces() {
return new Serializable[0];
public String[] getPropertySpaces() {
return new String[0];
}
@Override

View File

@ -594,7 +594,7 @@ public class CustomPersister implements EntityPersister {
return "CUSTOMS";
}
public Serializable[] getPropertySpaces() {
public String[] getPropertySpaces() {
return new String[] { "CUSTOMS" };
}

View File

@ -16,8 +16,6 @@ import org.hibernate.type.ListType;
import org.hibernate.type.MapType;
import org.hibernate.type.Type;
import java.io.Serializable;
import static org.hibernate.internal.util.StringHelper.root;
import static org.hibernate.jpamodelgen.validation.MockSessionFactory.typeConfiguration;
@ -146,8 +144,8 @@ public abstract class MockCollectionPersister implements QueryableCollection {
}
@Override
public Serializable[] getCollectionSpaces() {
return new Serializable[] {role};
public String[] getCollectionSpaces() {
return new String[] {role};
}
@Override

View File

@ -173,8 +173,8 @@ public abstract class MockEntityPersister implements EntityPersister, Queryable,
}
@Override
public Serializable[] getPropertySpaces() {
return new Serializable[] {entityName};
public String[] getPropertySpaces() {
return new String[] {entityName};
}
@Override