private void addProperties( List<Property> props, PropertyType pt, Mapping propMapping, ResultSet rs, String idPrefix ) throws SQLException { List<TypedObjectNode> particles = buildParticles( propMapping, rs, qualifiedSqlExprToRsIdx, idPrefix ); if ( particles.isEmpty() && pt.getMinOccurs() > 0 ) { if ( pt.isNillable() ) { Map<QName, PrimitiveValue> attrs = Collections.singletonMap( new QName( CommonNamespaces.XSINS, "nil" ), new PrimitiveValue( Boolean.TRUE ) ); props.add( new GenericProperty( pt, propMapping.getPath().getAsQName(), null, attrs, Collections.<TypedObjectNode> emptyList() ) ); } else { LOG.warn( "Unable to map NULL value for mapping '" + propMapping.getPath().getAsText() + "' to output. This will result in schema violations." ); } } for ( final TypedObjectNode particle : particles ) { if ( particle instanceof GenericXMLElement ) { if ( pt instanceof ObjectPropertyType && TIME_OBJECT.equals( ( (ObjectPropertyType) pt ).getCategory() ) ) { props.add( recreatePropertyFromGml( pt, (GenericXMLElement) particle ) ); } else { GenericXMLElement xmlEl = (GenericXMLElement) particle; props.add( new GenericProperty( pt, xmlEl.getName(), null, xmlEl.getAttributes(), xmlEl.getChildren() ) ); } } else { props.add( new GenericProperty( pt, pt.getName(), particle ) ); } } }