6 - SQM based on JPA type system

This commit is contained in:
Andrea Boriero 2019-05-28 10:36:11 +01:00
parent 11b820181e
commit fb12f3a60f
6 changed files with 16 additions and 16 deletions

View File

@ -2533,7 +2533,7 @@ public class SemanticQueryBuilder extends HqlParserBaseVisitor implements SqmCre
final SqmPathSource<?> pluralAttribute = sqmFrom.getReferencedPathSource();
if ( !( pluralAttribute instanceof PluralPersistentAttribute ) ) {
throw new ParsingException( "Could not resolve identification variable [" + alias + "] as plural-attribute" )
throw new ParsingException( "Could not resolve identification variable [" + alias + "] as plural-attribute" );
}
//noinspection unchecked

View File

@ -8,7 +8,7 @@ package org.hibernate.type.descriptor.java.spi;
import org.hibernate.collection.spi.CollectionSemantics;
import org.hibernate.collection.spi.PersistentCollection;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.type.descriptor.WrapperOptions;
import org.hibernate.type.descriptor.java.AbstractTypeDescriptor;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators;
@ -48,12 +48,12 @@ public class CollectionJavaTypeDescriptor<C> extends AbstractTypeDescriptor<C> {
}
@Override
public <X> X unwrap(C value, Class<X> type, SharedSessionContractImplementor session) {
public <X> X unwrap(C value, Class<X> type, WrapperOptions options) {
throw new UnsupportedOperationException( );
}
@Override
public <X> C wrap(X value, SharedSessionContractImplementor session) {
public <X> C wrap(X value, WrapperOptions options) {
throw new UnsupportedOperationException( );
}

View File

@ -9,7 +9,7 @@ package org.hibernate.type.descriptor.java.spi;
import java.sql.Types;
import javax.persistence.EnumType;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.type.descriptor.WrapperOptions;
import org.hibernate.type.descriptor.java.AbstractTypeDescriptor;
import org.hibernate.type.descriptor.java.ImmutableMutabilityPlan;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
@ -52,13 +52,13 @@ public class EnumJavaDescriptor<E extends Enum> extends AbstractTypeDescriptor<E
@Override
@SuppressWarnings("unchecked")
public <X> X unwrap(E value, Class<X> type, SharedSessionContractImplementor session) {
public <X> X unwrap(E value, Class<X> type, WrapperOptions options) {
return (X) value;
}
@Override
@SuppressWarnings("unchecked")
public <X> E wrap(X value, SharedSessionContractImplementor session) {
public <X> E wrap(X value, WrapperOptions options) {
return (E) value;
}

View File

@ -6,7 +6,7 @@
*/
package org.hibernate.type.descriptor.java.spi;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.type.descriptor.WrapperOptions;
import org.hibernate.type.descriptor.java.AbstractTypeDescriptor;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators;
@ -42,14 +42,14 @@ public class JavaTypeDescriptorBasicAdaptor<T> extends AbstractTypeDescriptor<T>
}
@Override
public <X> X unwrap(T value, Class<X> type, SharedSessionContractImplementor session) {
public <X> X unwrap(T value, Class<X> type, WrapperOptions options) {
throw new UnsupportedOperationException(
"Unwrap strategy not known for this Java type : " + getJavaType().getName()
);
}
@Override
public <X> T wrap(X value, SharedSessionContractImplementor session) {
public <X> T wrap(X value, WrapperOptions options) {
throw new UnsupportedOperationException(
"Wrap strategy not known for this Java type : " + getJavaType().getName()
);

View File

@ -11,8 +11,8 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Supplier;
import org.hibernate.boot.model.TypeContributor;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.internal.util.SerializationHelper;
import org.hibernate.type.descriptor.WrapperOptions;
import org.hibernate.type.descriptor.java.AbstractTypeDescriptor;
import org.hibernate.type.descriptor.java.JavaTypeDescriptor;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
@ -171,7 +171,7 @@ public class JavaTypeDescriptorRegistry implements JavaTypeDescriptorBaseline.Ba
}
@Override
public <X> X unwrap(T value, Class<X> type, SharedSessionContractImplementor session) {
public <X> X unwrap(T value, Class<X> type, WrapperOptions options) {
if ( type.equals( byte[].class ) ) {
throw new UnsupportedOperationException( "Cannot unwrap Serializable to format other than byte[]" );
}
@ -181,7 +181,7 @@ public class JavaTypeDescriptorRegistry implements JavaTypeDescriptorBaseline.Ba
@Override
@SuppressWarnings("unchecked")
public <X> T wrap(X value, SharedSessionContractImplementor session) {
public <X> T wrap(X value, WrapperOptions options) {
if ( value == null ) {
return null;
}

View File

@ -8,7 +8,7 @@ package org.hibernate.type.descriptor.java.spi;
import java.util.Map;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.type.descriptor.WrapperOptions;
import org.hibernate.type.descriptor.java.AbstractTypeDescriptor;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptor;
import org.hibernate.type.descriptor.sql.SqlTypeDescriptorIndicators;
@ -37,12 +37,12 @@ public class MapEntryJavaDescriptor extends AbstractTypeDescriptor<Map.Entry> {
}
@Override
public <X> X unwrap(Map.Entry value, Class<X> type, SharedSessionContractImplementor session) {
public <X> X unwrap(Map.Entry value, Class<X> type, WrapperOptions options) {
throw new UnsupportedOperationException( "Unsupported attempt to unwrap Map.Entry value" );
}
@Override
public <X> Map.Entry wrap(X value, SharedSessionContractImplementor session) {
public <X> Map.Entry wrap(X value, WrapperOptions options) {
throw new UnsupportedOperationException( "Unsupported attempt to wrap Map.Entry value" );
}
}