class VoteQueryService {

    /**
     * Logger.
     */
    private static final Logger LOGGER = LogManager.getLogger(VoteQueryService.class);

    /**
     * Vote repository.
     */
    @Inject
    private VoteRepository voteRepository;

    /**
     * Article repository.
     */
    @Inject
    private ArticleRepository articleRepository;

    /**
     * Comment repository.
     */
    @Inject
    private CommentRepository commentRepository;

    /**
     * Determines whether the specified user dose vote the specified entity.
     *
     * @param userId the specified user id
     * @param dataId the specified entity id
     * @return voted type, returns {@code -1} if has not voted yet
     */
    public int isVoted(final String userId, final String dataId) {
        try {
            final List<Filter> filters = new ArrayList<>();
            filters.add(new PropertyFilter(Vote.USER_ID, FilterOperator.EQUAL, userId));
            filters.add(new PropertyFilter(Vote.DATA_ID, FilterOperator.EQUAL, dataId));
            final Query query = new Query().setFilter(new CompositeFilter(CompositeFilterOperator.AND, filters));
            final JSONObject vote = voteRepository.getFirst(query);
            if (null == vote) {
                return -1;
            }

            return vote.optInt(Vote.TYPE);
        } catch (final RepositoryException e) {
            LOGGER.log(Level.ERROR, e.getMessage());
            return -1;
        }
    }

    /**
     * Determines whether the specified data dose belong to the specified user.
     *
     * @param userId   the specified user id
     * @param dataId   the specified data id
     * @param dataType the specified data type
     * @return {@code true} if it belongs to the user, otherwise returns {@code false}
     */
    public boolean isOwn(final String userId, final String dataId, final int dataType) {<FILL_FUNCTION_BODY>}
}

        try {
            if (Vote.DATA_TYPE_C_ARTICLE == dataType) {
                final JSONObject article = articleRepository.get(dataId);
                if (null == article) {
                    LOGGER.log(Level.ERROR, "Not found article [id={}]", dataId);

                    return false;
                }

                return article.optString(Article.ARTICLE_AUTHOR_ID).equals(userId);
            } else if (Vote.DATA_TYPE_C_COMMENT == dataType) {
                final JSONObject comment = commentRepository.get(dataId);
                if (null == comment) {
                    LOGGER.log(Level.ERROR, "Not found comment [id={}]", dataId);

                    return false;
                }

                return comment.optString(Comment.COMMENT_AUTHOR_ID).equals(userId);
            }

            return false;
        } catch (final RepositoryException e) {
            LOGGER.log(Level.ERROR, e.getMessage());

            return false;
        }
    
<no_super_class>