Code example for CollectionRemoveAction

                                            + MessageHelper.collectionInfoString(role, ownerIdentifier, source.getFactory())); 
		source.getActionQueue().addAction( new CollectionRemoveAction( owner, role, collectionKey, false, source ) ); 
	 * This version is slightly different for say 
	 * {@link org.hibernate.type.CollectionType#getKeyOfOwner} in that here we 
	 * need to assume that the owner is not yet associated with the session, 
	 * and thus we cannot rely on the owner's EntityEntry snapshot... 
	 * @param role The persister for the collection role being processed. 
	 * @return 
	final Serializable extractCollectionKeyFromOwner(CollectionPersister role) { 
        if ( role.getCollectionType().useLHSPrimaryKey() ) { 
			return ownerIdentifier; 
        return (Serializable)role.getOwnerEntityPersister().getPropertyValue( 
Contextual code suggestions in your IDE  Get Codota for Java