Code example for MappingException

0
		String tableName = getValue().getTable().getQualifiedName( identifierGeneratorFactory.getDialect() );
		params.setProperty( PersistentIdentifierGenerator.TABLE, tableName );
 
		//pass the column name (a generated id almost always has a single column) 
		if ( getSimpleValueSpan() > 1 ) { 
			throw new MappingException(
					"A SimpleAttributeBinding used for an identifier has more than 1 Value: " + getAttribute().getName() 
			); 
		} 
		SimpleValue simpleValue = (SimpleValue) getValue();
		if ( !Column.class.isInstance( simpleValue ) ) {
			throw new MappingException(
					"Cannot create an IdentifierGenerator because the value is not a column: " + 
							simpleValue.toLoggableString()
			); 
		} 
		params.setProperty(
				PersistentIdentifierGenerator.PK,
				( (Column) simpleValue ).getColumnName().encloseInQuotesIfQuoted(
						identifierGeneratorFactory.getDialect()
Contextual code suggestions in your IDE  Get Codota for Java