code: @Override
  	public int filterCountByCompanyId(long companyId) {
  		if (!InlineSQLHelperUtil.isEnabled(companyId, 0)) {
  			return countByCompanyId(companyId);
  		}
  
  		StringBundler query = new StringBundler(2);
  
  		query.append(_FILTER_SQL_COUNT_COMMERCEACCOUNT_WHERE);
  
  		query.append(_FINDER_COLUMN_COMPANYID_COMPANYID_2);
  
  		String sql = InlineSQLHelperUtil.replacePermissionCheck(query.toString(),
  				CommerceAccount.class.getName(),
  				_FILTER_ENTITY_TABLE_FILTER_PK_COLUMN);
  
  		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(companyId);
  
  			Long count = (Long)q.uniqueResult();
  
  			return count.intValue();
  		}
  		catch (Exception e) {
  			throw processException(e);
  		}
  		finally {
  			closeSession(session);
  		}
  	}
docs: Returns the number of commerce accounts that the user has permission to view where companyId = &#63;.
  
  @param companyId the company ID
  @return the number of matching commerce accounts that the user has permission to view