misc minor changes

This commit is contained in:
Gavin 2023-06-09 00:45:10 +02:00 committed by Gavin King
parent 3dff3fb20e
commit 0ae432f0fb
7 changed files with 32 additions and 11 deletions

View File

@ -677,7 +677,8 @@ public class AttributeFactory {
final AttributeMapping attributeMapping = embeddable.findAttributeMapping( attributeName );
if ( attributeMapping == null ) {
throw new PropertyNotFoundException(
"Unable to locate property named " + attributeName + " on " + embeddable.getJavaType().getJavaTypeClass().getName()
"Unable to locate property named '" + attributeName
+ "' of '" + embeddable.getJavaType().getJavaTypeClass().getName() + "'"
);
}

View File

@ -185,7 +185,7 @@ public abstract class AbstractManagedType<J>
new SemanticException(
String.format(
Locale.ROOT,
"Could not resolve attribute '%s' of '%s' due to the attribute being declared in multiple sub types: ['%s', '%s']",
"Could not resolve attribute '%s' of '%s' due to the attribute being declared in multiple subtypes: ['%s', '%s']",
name,
getTypeName(),
attribute.getDeclaringType().getTypeName(),

View File

@ -26,23 +26,43 @@ import org.hibernate.type.descriptor.java.JavaType;
* @author Steve Ebersole
*/
public class MappedSuperclassTypeImpl<J> extends AbstractIdentifiableType<J> implements MappedSuperclassDomainType<J> {
public MappedSuperclassTypeImpl(
String name,
boolean hasIdClass,
boolean hasIdProperty,
boolean hasVersion,
JavaType<J> javaType,
IdentifiableDomainType<? super J> superType,
JpaMetamodelImplementor jpaMetamodel) {
super(
name,
javaType,
superType,
hasIdClass,
hasIdProperty,
hasVersion,
jpaMetamodel
);
}
public MappedSuperclassTypeImpl(
JavaType<J> javaType,
MappedSuperclass mappedSuperclass,
IdentifiableDomainType<? super J> superType,
JpaMetamodelImplementor jpaMetamodel) {
super(
this(
javaType.getJavaType().getTypeName(),
javaType,
superType,
mappedSuperclass.getDeclaredIdentifierMapper() != null || ( superType != null && superType.hasIdClass() ),
mappedSuperclass.getDeclaredIdentifierMapper() != null
|| superType != null && superType.hasIdClass(),
mappedSuperclass.hasIdentifierProperty(),
mappedSuperclass.isVersioned(),
javaType,
superType,
jpaMetamodel
);
}
@Override
public String getPathName() {
return getTypeName();

View File

@ -5722,7 +5722,7 @@ public abstract class AbstractEntityPersister
new SemanticException(
String.format(
Locale.ROOT,
"Could not resolve attribute '%s' of '%s' due to the attribute being declared in multiple sub types: ['%s', '%s']",
"Could not resolve attribute '%s' of '%s' due to the attribute being declared in multiple subtypes: ['%s', '%s']",
name,
getJavaType().getJavaType().getTypeName(),
attribute.asAttributeMapping().getDeclaringType()

View File

@ -345,7 +345,7 @@ public class AnyType extends AbstractType implements CompositeType, AssociationT
return 1;
}
throw new PropertyNotFoundException( "Unable to locate property named " + name + " on AnyType" );
throw new PropertyNotFoundException( "Unable to locate property named '" + name + "'" );
}
@Override

View File

@ -726,7 +726,7 @@ public class ComponentType extends AbstractType implements CompositeTypeImplemen
}
}
throw new PropertyNotFoundException(
"Unable to locate property named " + name + " on " + getReturnedClass().getName()
"Unable to locate property named '" + name + "' of '" + getReturnedClass().getName() + "'"
);
}

View File

@ -128,7 +128,7 @@ public class TransientOverrideAsPersistentJoined {
catch (IllegalArgumentException e) {
assertThat(
ExceptionHelper.getRootCause( e ).getMessage(),
containsString( "due to the attribute being declared in multiple sub types" )
containsString( "due to the attribute being declared in multiple subtypes" )
);
}
} );