6 - SQM based on JPA type system

This commit is contained in:
Andrea Boriero 2019-07-11 11:40:12 +01:00
parent f48f486ec6
commit c0cabdbfe8
3 changed files with 8 additions and 5 deletions

View File

@ -937,7 +937,7 @@ public class StatefulPersistenceContext implements PersistenceContext {
} }
@Override @Override
public CollectionEntry addInitializedCollection(CollectionPersister persister, PersistentCollection collection, Object id) public CollectionEntry addInitializedCollection(CollectionPersister persister, PersistentCollection collection, Serializable id)
throws HibernateException { throws HibernateException {
final CollectionEntry ce = new CollectionEntry( collection, persister, id, flushing ); final CollectionEntry ce = new CollectionEntry( collection, persister, id, flushing );
ce.postInitialize( collection ); ce.postInitialize( collection );

View File

@ -409,7 +409,7 @@ public interface PersistenceContext {
CollectionEntry addInitializedCollection( CollectionEntry addInitializedCollection(
CollectionPersister persister, CollectionPersister persister,
PersistentCollection collection, PersistentCollection collection,
Object id); Serializable id);
/** /**
* Get the collection instance associated with the <tt>CollectionKey</tt> * Get the collection instance associated with the <tt>CollectionKey</tt>

View File

@ -6,6 +6,8 @@
*/ */
package org.hibernate.sql.results.spi; package org.hibernate.sql.results.spi;
import java.io.Serializable;
import org.hibernate.collection.spi.PersistentCollection; import org.hibernate.collection.spi.PersistentCollection;
import org.hibernate.engine.spi.CollectionEntry; import org.hibernate.engine.spi.CollectionEntry;
import org.hibernate.engine.spi.PersistenceContext; import org.hibernate.engine.spi.PersistenceContext;
@ -21,13 +23,14 @@ import org.hibernate.sql.exec.spi.ExecutionContext;
public class LoadingCollectionEntry { public class LoadingCollectionEntry {
private final CollectionPersister collectionDescriptor; private final CollectionPersister collectionDescriptor;
private final CollectionInitializer initializer; private final CollectionInitializer initializer;
private final Object key; // todo (6.0) : change from Serializable to Object
private final Serializable key;
private final PersistentCollection collectionInstance; private final PersistentCollection collectionInstance;
public LoadingCollectionEntry( public LoadingCollectionEntry(
CollectionPersister collectionDescriptor, CollectionPersister collectionDescriptor,
CollectionInitializer initializer, CollectionInitializer initializer,
Object key, Serializable key,
PersistentCollection collectionInstance) { PersistentCollection collectionInstance) {
this.collectionDescriptor = collectionDescriptor; this.collectionDescriptor = collectionDescriptor;
this.initializer = initializer; this.initializer = initializer;
@ -49,7 +52,7 @@ public class LoadingCollectionEntry {
return initializer; return initializer;
} }
public Object getKey() { public Serializable getKey() {
return key; return key;
} }