Skip to content

Commit

Permalink
Migrate type from Serializable[] to String[]
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanne committed Aug 23, 2023
1 parent ab0bd8d commit f49535d
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
*/
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<>();
Expand Down Expand Up @@ -211,7 +211,7 @@ private boolean affectedEntity(Set<?> affectedTableSpaces, Serializable[] checkT
}

@Override
public Serializable[] getPropertySpaces() {
public String[] getPropertySpaces() {
return affectedTableSpaces;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -101,7 +99,7 @@ public AfterTransactionCompletionProcess getAfterTransactionCompletionProcess()
}

@Override
public Serializable[] getPropertySpaces() {
public String[] getPropertySpaces() {
return persister.getCollectionSpaces();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -136,7 +134,7 @@ public final EntityPersister getPersister() {
}

@Override
public final Serializable[] getPropertySpaces() {
public final String[] getPropertySpaces() {
return persister.getPropertySpaces();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
*/
package org.hibernate.action.spi;

import java.io.Serializable;

import org.hibernate.HibernateException;
import org.hibernate.event.spi.EventSource;

Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ private void registerCleanupActions(Executable executable) {
beforeTransactionProcesses.register( executable.getBeforeTransactionCompletionProcess() );
}
if ( session.getFactory().getSessionFactoryOptions().isQueryCacheEnabled() ) {
invalidateSpaces( (String[]) executable.getPropertySpaces() );
invalidateSpaces( executable.getPropertySpaces() );
}
if ( executable.getAfterTransactionCompletionProcess() != null ) {
if ( afterTransactionProcesses == null ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -255,7 +254,7 @@ default BeforeExecutionGenerator getGenerator() {
/**
* Get the "space" that holds the persistent state
*/
Serializable[] getCollectionSpaces();
String[] getCollectionSpaces();

/**
* Get the user-visible metadata for the collection (optional operation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ default Object initializeEnhancedEntityUsedAsProxy(
*
* @return The property spaces.
*/
Serializable[] getPropertySpaces();
String[] getPropertySpaces();

/**
* Returns an array of objects that identify spaces in which properties of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -873,7 +872,7 @@ else if ( discriminatorValue == NOT_NULL_DISCRIMINATOR ) {
}

@Override
public Serializable[] getPropertySpaces() {
public String[] getPropertySpaces() {
return spaces; // don't need subclass tables, because they can't appear in conditions
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -502,7 +501,7 @@ public String getSubclassForDiscriminatorValue(Object value) {
}

@Override
public Serializable[] getPropertySpaces() {
public String[] getPropertySpaces() {
return spaces;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public String getSubclassForDiscriminatorValue(Object value) {
}

@Override
public Serializable[] getPropertySpaces() {
public String[] getPropertySpaces() {
return spaces;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ public boolean isSubclassEntityName(String entityName) {
}

@Override
public Serializable[] getPropertySpaces() {
return new Serializable[0];
public String[] getPropertySpaces() {
return new String[0];
}

@Override
Expand Down Expand Up @@ -924,8 +924,8 @@ public boolean hasManyToManyOrdering() {
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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -75,7 +75,7 @@ public boolean equals(Object obj) {
}

@Override
public Serializable[] getPropertySpaces() {
public String[] getPropertySpaces() {
return spaces;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -73,7 +73,7 @@ public boolean equals(Object obj) {
}

@Override
public Serializable[] getPropertySpaces() {
public String[] getPropertySpaces() {
return spaces;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ public boolean isSubclassEntityName(String entityName) {
}

@Override
public Serializable[] getPropertySpaces() {
return new Serializable[0];
public String[] getPropertySpaces() {
return new String[0];
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ public String getRootEntityName() {
return "CUSTOMS";
}

public Serializable[] getPropertySpaces() {
public String[] getPropertySpaces() {
return new String[] { "CUSTOMS" };
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
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;

Expand Down Expand Up @@ -146,8 +144,8 @@ public boolean isOneToMany() {
}

@Override
public Serializable[] getCollectionSpaces() {
return new Serializable[] {role};
public String[] getCollectionSpaces() {
return new String[] {role};
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ public String[] toColumns(String propertyName) {
}

@Override
public Serializable[] getPropertySpaces() {
return new Serializable[] {entityName};
public String[] getPropertySpaces() {
return new String[] {entityName};
}

@Override
Expand Down

0 comments on commit f49535d

Please sign in to comment.