@Override
	public int filterCountByG_T_E(long groupId, String type, boolean enabled) {
		if (!InlineSQLHelperUtil.isEnabled(groupId)) {
			return countByG_T_E(groupId, type, enabled);
		}

		StringBundler query = new StringBundler(4);

		query.append(_FILTER_SQL_COUNT_COMMERCENOTIFICATIONTEMPLATE_WHERE);

		query.append(_FINDER_COLUMN_G_T_E_GROUPID_2);

		boolean bindType = false;

		if (type == null) {
			query.append(_FINDER_COLUMN_G_T_E_TYPE_1_SQL);
		}
		else if (type.equals("")) {
			query.append(_FINDER_COLUMN_G_T_E_TYPE_3_SQL);
		}
		else {
			bindType = true;

			query.append(_FINDER_COLUMN_G_T_E_TYPE_2_SQL);
		}

		query.append(_FINDER_COLUMN_G_T_E_ENABLED_2);

		String sql = InlineSQLHelperUtil.replacePermissionCheck(query.toString(),
				CommerceNotificationTemplate.class.getName(),
				_FILTER_ENTITY_TABLE_FILTER_PK_COLUMN, groupId);

		Session session = null;

		try {
			session = openSession();

			SQLQuery q = session.createSynchronizedSQLQuery(sql);

			q.addScalar(COUNT_COLUMN_NAME,
				com.liferay.portal.kernel.dao.orm.Type.LONG);

			QueryPos qPos = QueryPos.getInstance(q);

			qPos.add(groupId);

			if (bindType) {
				qPos.add(type);
			}

			qPos.add(enabled);

			Long count = (Long)q.uniqueResult();

			return count.intValue();
		}
		catch (Exception e) {
			throw processException(e);
		}
		finally {
			closeSession(session);
		}
	}
@ Override public int filterCountByG_T_E ( long groupId , String type , boolean enabled ) { if ( ! InlineSQLHelperUtil . isEnabled ( groupId ) ) { return countByG_T_E ( groupId , type , enabled ) ; } StringBundler query = new StringBundler ( 4 ) ; query . append ( _FILTER_SQL_COUNT_COMMERCENOTIFICATIONTEMPLATE_WHERE ) ; query . append ( _FINDER_COLUMN_G_T_E_GROUPID_2 ) ; boolean bindType = false ; if ( type == null ) { query . append ( _FINDER_COLUMN_G_T_E_TYPE_1_SQL ) ; } else if ( type . equals ( "" ) ) { query . append ( _FINDER_COLUMN_G_T_E_TYPE_3_SQL ) ; } else { bindType = true ; query . append ( _FINDER_COLUMN_G_T_E_TYPE_2_SQL ) ; } query . append ( _FINDER_COLUMN_G_T_E_ENABLED_2 ) ; String sql = InlineSQLHelperUtil . replacePermissionCheck ( query . toString ( ) , CommerceNotificationTemplate . class . getName ( ) , _FILTER_ENTITY_TABLE_FILTER_PK_COLUMN , groupId ) ; Session session = null ; try { session = openSession ( ) ; SQLQuery q = session . createSynchronizedSQLQuery ( sql ) ; q . addScalar ( COUNT_COLUMN_NAME , com . liferay . portal . kernel . dao . orm . Type . LONG ) ; QueryPos qPos = QueryPos . getInstance ( q ) ; qPos . add ( groupId ) ; if ( bindType ) { qPos . add ( type ) ; } qPos . add ( enabled ) ; Long count = ( Long ) q . uniqueResult ( ) ; return count . intValue ( ) ; } catch ( Exception e ) { throw processException ( e ) ; } finally { closeSession ( session ) ; } }
Returns the number of commerce notification templates that the user has permission to view where groupId = &#63; and type = &#63; and enabled = &#63;.

@param groupId the group ID
@param type the type
@param enabled the enabled
@return the number of matching commerce notification templates that the user has permission to view