Code example for CollectionRemoveAction

0
                                            + 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( 
				owner, 
				role.getCollectionType().getLHSPropertyName() 
Experience pair programming with AI  Get Codota for Java