From c0cabdbfe8ce4c3d8ff68da0daaeeb6a7ff79044 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Thu, 11 Jul 2019 11:40:12 +0100 Subject: [PATCH] 6 - SQM based on JPA type system --- .../engine/internal/StatefulPersistenceContext.java | 2 +- .../org/hibernate/engine/spi/PersistenceContext.java | 2 +- .../sql/results/spi/LoadingCollectionEntry.java | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java b/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java index 0856e0a3b2..9b6aa5b6f0 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/internal/StatefulPersistenceContext.java @@ -937,7 +937,7 @@ public class StatefulPersistenceContext implements PersistenceContext { } @Override - public CollectionEntry addInitializedCollection(CollectionPersister persister, PersistentCollection collection, Object id) + public CollectionEntry addInitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id) throws HibernateException { final CollectionEntry ce = new CollectionEntry( collection, persister, id, flushing ); ce.postInitialize( collection ); diff --git a/hibernate-core/src/main/java/org/hibernate/engine/spi/PersistenceContext.java b/hibernate-core/src/main/java/org/hibernate/engine/spi/PersistenceContext.java index 27bdf27210..8ac69a0d4f 100644 --- a/hibernate-core/src/main/java/org/hibernate/engine/spi/PersistenceContext.java +++ b/hibernate-core/src/main/java/org/hibernate/engine/spi/PersistenceContext.java @@ -409,7 +409,7 @@ public interface PersistenceContext { CollectionEntry addInitializedCollection( CollectionPersister persister, PersistentCollection collection, - Object id); + Serializable id); /** * Get the collection instance associated with the CollectionKey diff --git a/hibernate-core/src/main/java/org/hibernate/sql/results/spi/LoadingCollectionEntry.java b/hibernate-core/src/main/java/org/hibernate/sql/results/spi/LoadingCollectionEntry.java index 67087249ee..392eb24b90 100644 --- a/hibernate-core/src/main/java/org/hibernate/sql/results/spi/LoadingCollectionEntry.java +++ b/hibernate-core/src/main/java/org/hibernate/sql/results/spi/LoadingCollectionEntry.java @@ -6,6 +6,8 @@ */ package org.hibernate.sql.results.spi; +import java.io.Serializable; + import org.hibernate.collection.spi.PersistentCollection; import org.hibernate.engine.spi.CollectionEntry; import org.hibernate.engine.spi.PersistenceContext; @@ -21,13 +23,14 @@ import org.hibernate.sql.exec.spi.ExecutionContext; public class LoadingCollectionEntry { private final CollectionPersister collectionDescriptor; private final CollectionInitializer initializer; - private final Object key; + // todo (6.0) : change from Serializable to Object + private final Serializable key; private final PersistentCollection collectionInstance; public LoadingCollectionEntry( CollectionPersister collectionDescriptor, CollectionInitializer initializer, - Object key, + Serializable key, PersistentCollection collectionInstance) { this.collectionDescriptor = collectionDescriptor; this.initializer = initializer; @@ -49,7 +52,7 @@ public class LoadingCollectionEntry { return initializer; } - public Object getKey() { + public Serializable getKey() { return key; }