mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-26 13:25:19 +00:00
HHH-8816 - Unable to instantiate AttributeConverter: root cause of exception hidden
This commit is contained in:
parent
fc577724fb
commit
d023c7c95c
@ -2629,16 +2629,24 @@ public void setCurrentTenantIdentifierResolver(CurrentTenantIdentifierResolver c
|
||||
* by its "entity attribute" parameterized type?
|
||||
*/
|
||||
public void addAttributeConverter(Class<? extends AttributeConverter> attributeConverterClass, boolean autoApply) {
|
||||
final AttributeConverter attributeConverter;
|
||||
addAttributeConverter(
|
||||
instantiateAttributeConverter( attributeConverterClass ),
|
||||
autoApply
|
||||
);
|
||||
}
|
||||
|
||||
private AttributeConverter instantiateAttributeConverter(Class<? extends AttributeConverter> attributeConverterClass) {
|
||||
AttributeConverter attributeConverter;
|
||||
try {
|
||||
attributeConverter = attributeConverterClass.newInstance();
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new AnnotationException(
|
||||
"Unable to instantiate AttributeConverter [" + attributeConverterClass.getName() + "]"
|
||||
"Unable to instantiate AttributeConverter [" + attributeConverterClass.getName() + "]",
|
||||
e
|
||||
);
|
||||
}
|
||||
addAttributeConverter( attributeConverter, autoApply );
|
||||
return attributeConverter;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2647,17 +2655,7 @@ public void addAttributeConverter(Class<? extends AttributeConverter> attributeC
|
||||
* @param attributeConverterClass The AttributeConverter class.
|
||||
*/
|
||||
public void addAttributeConverter(Class<? extends AttributeConverter> attributeConverterClass) {
|
||||
final AttributeConverter attributeConverter;
|
||||
try {
|
||||
attributeConverter = attributeConverterClass.newInstance();
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new AnnotationException(
|
||||
"Unable to instantiate AttributeConverter [" + attributeConverterClass.getName() + "]"
|
||||
);
|
||||
}
|
||||
|
||||
addAttributeConverter( attributeConverter );
|
||||
addAttributeConverter( instantiateAttributeConverter( attributeConverterClass ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user