public static double getLimitByUserAndCounter(EntityManager em, PrincipalUser user, PolicyCounter counter) {
        PolicyLimit pLimit = findPolicyLimitByUserAndCounter(em, user, counter);

        if (pLimit != null) {
            return pLimit.getLimit();
        }
        return counter.getDefaultValue();
    }
public static double getLimitByUserAndCounter ( EntityManager em , PrincipalUser user , PolicyCounter counter ) { PolicyLimit pLimit = findPolicyLimitByUserAndCounter ( em , user , counter ) ; if ( pLimit != null ) { return pLimit . getLimit ( ) ; } return counter . getDefaultValue ( ) ; }
Retrieves the limit for a given user-counter combination.

@param   em       The EntityManager to use.
@param   user     The user for which to retrieve the policy limit.
@param   counter  The counter for which to retrieve the policy limit.

@return  The limit for the given user-counter combination. Default value of the counter is no such record exists.