<commit_before>package com.evolveum.midpoint.repo.sql.data.common;

import javax.persistence.Column;
import javax.persistence.Embeddable;

import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.Type;

import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.repo.sql.util.DtoTranslationException;
import com.evolveum.midpoint.xml.ns._public.common.common_2a.CapabilitiesType;
import com.evolveum.midpoint.xml.ns._public.common.common_2a.CapabilityCollectionType;
import com.evolveum.midpoint.xml.ns._public.common.common_2a.ResourceType;

@Embeddable
public class RCapabilities {

	private String _native;
	private String configured;

	@Column(nullable = true)
	@Type(type = "org.hibernate.type.TextType")
	public String getNative() {
		return _native;
	}

	public void setNative(String _native) {
		this._native = _native;
	}

	@Column(nullable = true)
	@Type(type = "org.hibernate.type.TextType")
	public String getConfigured() {
		return configured;
	}

	public void setConfigured(String configured) {
		this.configured = configured;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		RCapabilities that = (RCapabilities) o;

		if (_native != null ? !_native.equals(that._native) : that._native != null)
			return false;
		if (configured != null ? !configured.equals(that.configured) : that._native != null)
			return false;
		return true;
	}

	@Override
	public int hashCode() {
		int result = configured != null ? configured.hashCode() : 0;
		result = 31 * result + (_native != null ? _native.hashCode() : 0);

		return result;
	}

	@Override
	public String toString() {
		return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
	}

	public static void copyFromJAXB(CapabilitiesType jaxb, RCapabilities repo, PrismContext prismContext)
			throws DtoTranslationException {
		Validate.notNull(repo);
		Validate.notNull(jaxb);

		try {
			repo.setNative(RUtil.toRepo(jaxb.getNative(), prismContext));
			repo.setConfigured(RUtil.toRepo(jaxb.getConfigured(), prismContext));
		} catch (Exception ex) {
			throw new DtoTranslationException(ex.getMessage(), ex);
		}
	}

	public boolean empty() {
		return StringUtils.isBlank(_native) && StringUtils.isBlank(configured);
	}

	public static void copyToJAXB(RCapabilities repo, CapabilitiesType jaxb, PrismContext prismContext)
			throws DtoTranslationException {
		Validate.notNull(repo);
		Validate.notNull(jaxb);
		try {
			jaxb.setNative(RUtil.toJAXB(CapabilitiesType.class, new ItemPath(CapabilitiesType.F__NATIVE),
					repo.getNative(), CapabilityCollectionType.class, prismContext));
			jaxb.setConfigured(RUtil.toJAXB(CapabilitiesType.class, new ItemPath(CapabilitiesType.F__NATIVE),
					repo.getConfigured(), CapabilityCollectionType.class, prismContext));
		} catch (Exception ex) {
			throw new DtoTranslationException(ex.getMessage(), ex);
		}
	}

	public CapabilitiesType toJAXB(PrismContext prismContext) throws DtoTranslationException {
		CapabilitiesType cap = new CapabilitiesType();
		copyToJAXB(this, cap, prismContext);<commit_msg>updated capabilities.cachingMetadata. fix for MID-993<commit_after>package com.evolveum.midpoint.repo.sql.data.common;

import javax.persistence.Column;
import javax.persistence.Embeddable;

import com.evolveum.midpoint.xml.ns._public.common.common_2a.CachingMetadataType;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.lang.Validate;
import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.Type;

import com.evolveum.midpoint.prism.PrismContext;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.repo.sql.util.DtoTranslationException;
import com.evolveum.midpoint.xml.ns._public.common.common_2a.CapabilitiesType;
import com.evolveum.midpoint.xml.ns._public.common.common_2a.CapabilityCollectionType;
import com.evolveum.midpoint.xml.ns._public.common.common_2a.ResourceType;

@Embeddable
public class RCapabilities {

    private String cachingMetadata;
	private String _native;
	private String configured;

    @Column(nullable = true)
    @Type(type = "org.hibernate.type.TextType")
    public String getCachingMetadata() {
        return cachingMetadata;
    }

    @Column(nullable = true)
	@Type(type = "org.hibernate.type.TextType")
	public String getNative() {
		return _native;
	}

    @Column(nullable = true)
    @Type(type = "org.hibernate.type.TextType")
    public String getConfigured() {
        return configured;
    }

    public void setCachingMetadata(String cachingMetadata) {
        this.cachingMetadata = cachingMetadata;
    }

    public void setNative(String _native) {
		this._native = _native;
	}

	public void setConfigured(String configured) {
		this.configured = configured;
	}

	@Override
	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		RCapabilities that = (RCapabilities) o;

        if (cachingMetadata != null ? !cachingMetadata.equals(that.cachingMetadata) : that.cachingMetadata != null)
            return false;
		if (_native != null ? !_native.equals(that._native) : that._native != null)
			return false;
		if (configured != null ? !configured.equals(that.configured) : that._native != null)
			return false;
		return true;
	}

	@Override
	public int hashCode() {
		int result = configured != null ? configured.hashCode() : 0;
		result = 31 * result + (_native != null ? _native.hashCode() : 0);
        result = 31 * result + (cachingMetadata != null ? cachingMetadata.hashCode() : 0);

		return result;
	}

	@Override
	public String toString() {
		return ReflectionToStringBuilder.toString(this, ToStringStyle.MULTI_LINE_STYLE);
	}

	public static void copyFromJAXB(CapabilitiesType jaxb, RCapabilities repo, PrismContext prismContext)
			throws DtoTranslationException {
		Validate.notNull(repo);
		Validate.notNull(jaxb);

		try {
			repo.setNative(RUtil.toRepo(jaxb.getNative(), prismContext));
			repo.setConfigured(RUtil.toRepo(jaxb.getConfigured(), prismContext));
            repo.setCachingMetadata(RUtil.toRepo(jaxb.getCachingMetadata(), prismContext));
		} catch (Exception ex) {
			throw new DtoTranslationException(ex.getMessage(), ex);
		}
	}

	public boolean empty() {
		return StringUtils.isBlank(_native) && StringUtils.isBlank(configured);
	}

	public static void copyToJAXB(RCapabilities repo, CapabilitiesType jaxb, PrismContext prismContext)
			throws DtoTranslationException {
		Validate.notNull(repo);
		Validate.notNull(jaxb);
		try {
			jaxb.setNative(RUtil.toJAXB(CapabilitiesType.class, new ItemPath(CapabilitiesType.F__NATIVE),
					repo.getNative(), CapabilityCollectionType.class, prismContext));
			jaxb.setConfigured(RUtil.toJAXB(CapabilitiesType.class, new ItemPath(CapabilitiesType.F_CONFIGURED),
					repo.getConfigured(), CapabilityCollectionType.class, prismContext));
            jaxb.setCachingMetadata(RUtil.toJAXB(CachingMetadataType.class,
                    new ItemPath(CapabilitiesType.F_CACHING_METADATA), repo.getCachingMetadata(),
                    CachingMetadataType.class, prismContext));
		} catch (Exception ex) {
			throw new DtoTranslationException(ex.getMessage(), ex);
		}
	}

	public CapabilitiesType toJAXB(PrismContext prismContext) throws DtoTranslationException {
		CapabilitiesType cap = new CapabilitiesType();
		copyToJAXB(this, cap, prismContext);
{'fraction_non_alphanumeric': 0.1095679012345679, 'fraction_numerical': 0.002700617283950617, 'mean_word_length': 4.869433962264151, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 7}, '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': '3441714', 'n_tokens_mistral': 2604, 'n_tokens_neox': 2420, 'n_words': 466}