Code example for MappingException

0
 
	@Override 
    public void validate(Mapping mapping) throws MappingException { 
		super.validate(mapping); 
		if ( !getIdentifier().isValid(mapping) ) { 
			throw new MappingException( 
				"identifier mapping has wrong number of columns: " + 
				getEntityName() + 
				" type: " + 
				getIdentifier().getType().getName() 
			); 
		} 
		checkCompositeIdentifier(); 
	} 
 
	private void checkCompositeIdentifier() { 
		if ( getIdentifier() instanceof Component ) { 
			Component id = (Component) getIdentifier(); 
			if ( !id.isDynamic() ) { 
				Class idClass = id.getComponentClass();