<commit_before>package eu.bcvsolutions.idm.core.api.audit.criteria;

import org.hibernate.envers.configuration.spi.AuditConfiguration;
import org.hibernate.envers.internal.reader.AuditReaderImplementor;
import org.hibernate.envers.internal.tools.query.Parameters;
import org.hibernate.envers.internal.tools.query.QueryBuilder;
import org.hibernate.envers.query.criteria.AuditCriterion;
import org.hibernate.envers.query.criteria.internal.IlikeAuditExpression;
import org.hibernate.envers.query.criteria.internal.RelatedAuditExpression;

/**
 * Product audit query criterion for comparing specific fields. That isn't accessible by
 * default audit criterions. For example {@link RelatedAuditExpression}, {@link IlikeAuditExpression}, ...
 *
 * @author <NAME>
 *
 */
public class IdmRelationAuditExpression implements AuditCriterion {

	public static final String EQUALS_SIGN = "=";

	private final String rightPropertyName;
	private final String leftPropertyName;
	private final String op;
	
	public IdmRelationAuditExpression(String leftPropertyNamel, String opl, String rightPropertyNamel) {
		this.leftPropertyName = leftPropertyNamel;
		this.op = opl;
		this.rightPropertyName = rightPropertyNamel;
	}

	@Override
	public void addToQuery(AuditConfiguration auditCfg, AuditReaderImplementor versionsReader, String entityName,
			QueryBuilder qb, Parameters parameters) {
		parameters.addWhere(leftPropertyName, op, rightPropertyName);
	}
}<commit_msg>#1185 fix attribute name<commit_after>package eu.bcvsolutions.idm.core.api.audit.criteria;

import org.hibernate.envers.configuration.spi.AuditConfiguration;
import org.hibernate.envers.internal.reader.AuditReaderImplementor;
import org.hibernate.envers.internal.tools.query.Parameters;
import org.hibernate.envers.internal.tools.query.QueryBuilder;
import org.hibernate.envers.query.criteria.AuditCriterion;
import org.hibernate.envers.query.criteria.internal.IlikeAuditExpression;
import org.hibernate.envers.query.criteria.internal.RelatedAuditExpression;

/**
 * Product audit query criterion for comparing specific fields. That isn't accessible by
 * default audit criterions. For example {@link RelatedAuditExpression}, {@link IlikeAuditExpression}, ...
 *
 * @author <NAME>
 *
 */
public class IdmRelationAuditExpression implements AuditCriterion {

	public static final String EQUALS_SIGN = "=";

	private final String rightPropertyName;
	private final String leftPropertyName;
	private final String op;
	
	public IdmRelationAuditExpression(String leftPropertyName, String op, String rightPropertyName) {
		this.leftPropertyName = leftPropertyName;
		this.op = op;
		this.rightPropertyName = rightPropertyName;
	}

	@Override
	public void addToQuery(AuditConfiguration auditCfg, AuditReaderImplementor versionsReader, String entityName,
			QueryBuilder qb, Parameters parameters) {
		parameters.addWhere(leftPropertyName, op, rightPropertyName);
	}
}
{'fraction_non_alphanumeric': 0.08485056681552731, 'fraction_numerical': 0.0013740982480247338, 'mean_word_length': 6.316582914572864, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2283548', 'n_tokens_mistral': 872, 'n_tokens_neox': 812, 'n_words': 183}