<commit_before>package net.kaleidos.hibernate.criterion.hstore;

import java.util.Map;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.criterion.CriteriaQuery;
import org.hibernate.criterion.Criterion;
import org.hibernate.engine.TypedValue;
import org.hibernate.type.Type;
import org.hibernate.type.StringType;
import org.hibernate.util.StringHelper;

import net.kaleidos.hibernate.usertype.HstoreHelper;

/**
 * Constrains a property in an hstore
 */
public class PgHstoreOperatorExpression implements Criterion {
    private static final long serialVersionUID = 2872183637309166619L;

    private final String propertyName;
    private final Map<String,String> value;
    private final String operator;

    private static final TypedValue[] NO_VALUES = new TypedValue[0];

    protected PgHstoreOperatorExpression(String propertyName, Map<String,String> value, String operator) {
        this.propertyName = propertyName;
        this.value = value;
        this.operator = operator;
    }

    @Override
    public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException {<commit_msg>Fixes Map type in order to reflect HstoreHelper.toString() signature change.<commit_after>package net.kaleidos.hibernate.criterion.hstore;

import java.util.Map;
import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.HibernateException;
import org.hibernate.criterion.CriteriaQuery;
import org.hibernate.criterion.Criterion;
import org.hibernate.engine.TypedValue;
import org.hibernate.type.Type;
import org.hibernate.type.StringType;
import org.hibernate.util.StringHelper;

import net.kaleidos.hibernate.usertype.HstoreHelper;

/**
 * Constrains a property in an hstore
 */
public class PgHstoreOperatorExpression implements Criterion {
    private static final long serialVersionUID = 2872183637309166619L;

    private final String propertyName;
    private final Map<Object,String> value;
    private final String operator;

    private static final TypedValue[] NO_VALUES = new TypedValue[0];

    protected PgHstoreOperatorExpression(String propertyName, Map<Object,String> value, String operator) {
        this.propertyName = propertyName;
        this.value = value;
        this.operator = operator;
    }

    @Override
    public String toSqlString(Criteria criteria, CriteriaQuery criteriaQuery) throws HibernateException {
{'fraction_non_alphanumeric': 0.07745617611088464, 'fraction_numerical': 0.016306563391765186, 'mean_word_length': 4.899038461538462, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6081367', 'n_tokens_mistral': 734, 'n_tokens_neox': 659, 'n_words': 173}