class ReferralRepository extends AbstractRepository {

    /**
     * Gets a referral by the specified data id and IP.
     *
     * @param dataId the specified data id
     * @param ip     the specified IP
     * @return referral, returns {@code null} if not found
     * @throws RepositoryException repository exception
     */
    public JSONObject getByDataIdAndIP(final String dataId, final String ip) throws RepositoryException {<FILL_FUNCTION_BODY>}

    /**
     * Public constructor.
     */
    public ReferralRepository() {
        super(Referral.REFERRAL);
    }
}

        final Query query = new Query().setFilter(CompositeFilterOperator.and(
                new PropertyFilter(Referral.REFERRAL_DATA_ID, FilterOperator.EQUAL, dataId),
                new PropertyFilter(Referral.REFERRAL_IP, FilterOperator.EQUAL, ip))).setPageCount(1).setPage(1, 1);
        return getFirst(query);
    
<no_super_class>