private void addKeyManyToOnesToSession(ResultSetProcessingContextImpl context, CompositeType componentType, Object component ) {
for ( int i = 0 ; i < componentType.getSubtypes().length ; i++ ) {
final Type subType = componentType.getSubtypes()[ i ];
final Object subValue = componentType.getPropertyValue( component, i, context.getSession() );
if ( subType.isEntityType() ) {
( (Session) context.getSession() ).buildLockRequest( LockOptions.NONE ).lock( subValue );
}
else if ( subType.isComponentType() ) {
addKeyManyToOnesToSession( context, (ComponentType) subType, subValue ); }
}
}