}
fromAndWhere = fromAndWhereSb.substring( 0, fromAndWhereSb.length() - 5 );
}
if ( value instanceof Component ) {
Component component = (Component) value;
Iterator properties = component.getPropertyIterator();
Component indexComponent = new Component( mappings, collection );
indexComponent.setComponentClassName( component.getComponentClassName() );
//TODO I don't know if this is appropriate
indexComponent.setNodeName( "index" );
while ( properties.hasNext() ) {
Property current = (Property) properties.next();
Property newProperty = new Property();
newProperty.setCascade( current.getCascade() );
newProperty.setValueGenerationStrategy( current.getValueGenerationStrategy() );
newProperty.setInsertable( false );
newProperty.setUpdateable( false );
newProperty.setMetaAttributes( current.getMetaAttributes() );
newProperty.setName( current.getName() );
newProperty.setNodeName( current.getNodeName() );
newProperty.setNaturalIdentifier( false );
//newProperty.setOptimisticLocked( false );
newProperty.setOptional( false );
newProperty.setPersistentClass( current.getPersistentClass() );
newProperty.setPropertyAccessorName( current.getPropertyAccessorName() );
newProperty.setSelectable( current.isSelectable() );
newProperty.setValue(
createFormulatedValue(
current.getValue(), collection, targetPropertyName, associatedClass, mappings
)
);
indexComponent.addProperty( newProperty );
}
return indexComponent;
}
else if ( value instanceof SimpleValue ) {
SimpleValue sourceValue = (SimpleValue) value;