@Override
    protected int getCountInternal(Query query) throws IOException {
        // TODO: support query filter
        Filter filter = query.getFilter();
        if (filter != null) {
            //LOGGER.severe("Unhandled filter in getCountInternal" + query.getFilter());
            LOGGER.warning("Unable handler filter in getCountInternal" + query.getFilter().getClass().getName());
        }
        
        int count = -1;
        try {
            Statement q = getDataStore().getConnection().createStatement();
            ResultSet res = q.executeQuery("SELECT COUNT(*) FROM " + typeName);

            count = res.getInt(1);

            res.close();
            q.close();
        } catch (SQLException e) {
            throw new IOException(e);
        }
        
        if (checkLimitOffset(query)) {
            final int limit = query.getMaxFeatures();
            
            if (limit > count) {
                count = limit;
            }
        }
        
        System.out.println("FeatureCount: " + count);
        
        return count;
    }