if ( navigable instanceof EmbeddedValuedNavigable ) { final EmbeddedTypeDescriptor embeddedDescriptor = ( (EmbeddedValuedNavigable) navigable ).getEmbeddedDescriptor(); checkNullabilityInternal( embeddedDescriptor.getPropertyValues( value ), embeddedDescriptor, final EmbeddedTypeDescriptor embeddedDescriptor = ( (CollectionElementEmbedded) elementDescriptor ) .getEmbeddedDescriptor(); checkNullabilityInternal( embeddedDescriptor.getPropertyValues( value ), embeddedDescriptor,
public void checkNullability( final Object[] values, final EntityTypeDescriptor entityDescriptor, final NullabilityCheckType checkType) { /* * Typically when Bean Validation is on, we don't want to validate null values * at the Hibernate Core level. Hence the checkNullability setting. */ if ( !checkNullability ) { return; } final PathCollector collector = new PathCollector(); checkNullabilityInternal( values, entityDescriptor, checkType, collector ); if ( collector.hasAny() ) { throw new PropertyValueException( "not-null property references a null or transient value", entityDescriptor.getEntityName(), collector.collectedString() ); } }