public static function doUpdate($values, PropelPDO $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection(UserRolePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
        }

        $selectCriteria = new Criteria(UserRolePeer::DATABASE_NAME);

        if ($values instanceof Criteria) {
            $criteria = clone $values; // rename for clarity

            $comparison = $criteria->getComparison(UserRolePeer::USER_ID);
            $value = $criteria->remove(UserRolePeer::USER_ID);
            if ($value) {
                $selectCriteria->add(UserRolePeer::USER_ID, $value, $comparison);
            } else {
                $selectCriteria->setPrimaryTableName(UserRolePeer::TABLE_NAME);
            }

            $comparison = $criteria->getComparison(UserRolePeer::ROLE_ID);
            $value = $criteria->remove(UserRolePeer::ROLE_ID);
            if ($value) {
                $selectCriteria->add(UserRolePeer::ROLE_ID, $value, $comparison);
            } else {
                $selectCriteria->setPrimaryTableName(UserRolePeer::TABLE_NAME);
            }

        } else { // $values is UserRole object
            $criteria = $values->buildCriteria(); // gets full criteria
            $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
        }

        // set the correct dbName
        $criteria->setDbName(UserRolePeer::DATABASE_NAME);

        return BasePeer::doUpdate($selectCriteria, $criteria, $con);
    }