@@ -469,7 +469,7 @@ private void bindBasicSetCollectionTablePrimaryKey(final SetBinding attributeBin
469
469
final BasicPluralAttributeElementBinding elementBinding =
470
470
( BasicPluralAttributeElementBinding ) attributeBinding .getPluralAttributeElementBinding ();
471
471
if ( elementBinding .getNature () != PluralAttributeElementBinding .Nature .BASIC ) {
472
- bindingContext ().makeMappingException ( String .format (
472
+ throw bindingContext ().makeMappingException ( String .format (
473
473
"Expected a SetBinding with an element of nature Nature.BASIC; instead was %s" ,
474
474
elementBinding .getNature () ) );
475
475
}
@@ -1081,7 +1081,7 @@ private void bindHibernateTypeDescriptor(
1081
1081
final String defaultJavaTypeName ) {
1082
1082
if ( explicitTypeName == null ) {
1083
1083
if ( hibernateTypeDescriptor .getJavaTypeName () != null ) {
1084
- bindingContext ().makeMappingException ( String .format (
1084
+ throw bindingContext ().makeMappingException ( String .format (
1085
1085
"Attempt to re-initialize (non-explicit) Java type name; current=%s new=%s" ,
1086
1086
hibernateTypeDescriptor .getJavaTypeName (),
1087
1087
defaultJavaTypeName ) );
@@ -1091,7 +1091,7 @@ private void bindHibernateTypeDescriptor(
1091
1091
// Check if user-specified name is of a User-Defined Type (UDT)
1092
1092
final TypeDefinition typeDef = metadata .getTypeDefinition ( explicitTypeName );
1093
1093
if ( hibernateTypeDescriptor .getExplicitTypeName () != null ) {
1094
- bindingContext ().makeMappingException ( String .format (
1094
+ throw bindingContext ().makeMappingException ( String .format (
1095
1095
"Attempt to re-initialize explicity-mapped Java type name; current=%s new=%s" ,
1096
1096
hibernateTypeDescriptor .getExplicitTypeName (),
1097
1097
explicitTypeName ) );
@@ -1151,7 +1151,7 @@ private void bindIdentifierGenerator(final EntityBinding rootEntityBinding) {
1151
1151
entityIdentifier .createIdentifierGenerator ( identifierGeneratorFactory , properties );
1152
1152
if ( IdentityGenerator .class .isInstance ( entityIdentifier .getIdentifierGenerator () ) ) {
1153
1153
if ( rootEntityBinding .getPrimaryTable ().getPrimaryKey ().getColumnSpan () != 1 ) {
1154
- bindingContext ().makeMappingException ( String .format (
1154
+ throw bindingContext ().makeMappingException ( String .format (
1155
1155
"ID for %s is mapped as an identity with %d columns. IDs mapped as an identity can only have 1 column." ,
1156
1156
rootEntityBinding .getEntity ().getName (),
1157
1157
rootEntityBinding .getPrimaryTable ().getPrimaryKey ().getColumnSpan ()
@@ -1978,7 +1978,7 @@ private void bindSortingAndOrdering(
1978
1978
try {
1979
1979
attributeBinding .setComparator ( comparatorClass .newInstance () );
1980
1980
} catch ( Exception error ) {
1981
- bindingContext ().makeMappingException (
1981
+ throw bindingContext ().makeMappingException (
1982
1982
String .format (
1983
1983
"Unable to create comparator [%s] for attribute [%s]" ,
1984
1984
sortable .getComparatorName (),
@@ -2223,7 +2223,7 @@ private Column createColumn(
2223
2223
final boolean isNullableByDefault ,
2224
2224
final boolean isDefaultAttributeName ) {
2225
2225
if ( columnSource .getName () == null && defaultName == null ) {
2226
- bindingContext ().makeMappingException ( "Cannot resolve name for column because no name was specified and default name is null." );
2226
+ throw bindingContext ().makeMappingException ( "Cannot resolve name for column because no name was specified and default name is null." );
2227
2227
}
2228
2228
final String name ;
2229
2229
if ( StringHelper .isNotEmpty ( columnSource .getName () ) ) {
@@ -2619,7 +2619,7 @@ private EntityBinding findOrBindingEntityBinding(final String entityName) {
2619
2619
final EntitySource entitySource = entitySourcesByName .get ( entityName );
2620
2620
if ( entitySource == null ) {
2621
2621
String msg = log .missingEntitySource ( entityName );
2622
- bindingContext ().makeMappingException ( msg );
2622
+ throw bindingContext ().makeMappingException ( msg );
2623
2623
}
2624
2624
2625
2625
// Get super entity binding (creating it if necessary using recursive call to this method)
0 commit comments