<commit_before>/*
 * Copyright (c) 2008-2016 Haulmont.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
package com.haulmont.cuba.security.entity;

import com.haulmont.cuba.core.entity.StandardEntity;
import com.haulmont.cuba.core.entity.annotation.SystemLevel;

import javax.persistence.*;

/**
 * Security constraint definition entity.
 */
@Entity(name = "sec$Constraint")
@Table(name = "SEC_CONSTRAINT")
@SystemLevel
public class Constraint extends StandardEntity {

    private static final long serialVersionUID = -8598548105315052474L;

    @Column(name = "CHECK_TYPE", length = 50, nullable = false)
    protected String checkType = ConstraintCheckType.DATABASE.getId();

    @Column(name = "OPERATION_TYPE", length = 50, nullable = false)
    protected String operationType = ConstraintOperationType.READ.getId();

    @Column(name = "CODE", length = 255)
    protected String code;

    @Column(name = "ENTITY_NAME", length = 255, nullable = false)
    protected String entityName;

    @Column(name = "JOIN_CLAUSE", length = 500)
    protected String joinClause;

    @Column(name = "WHERE_CLAUSE", length = 1000)
    protected String whereClause;

    @Lob
    @Column(name = "GROOVY_SCRIPT")
    protected String groovyScript;

    @Lob
    @Column(name = "FILTER_XML")
    protected String filterXml;

    @Column(name = "IS_ACTIVE")
    protected Boolean isActive = true;

    @ManyToOne
    @JoinColumn(name = "GROUP_ID")
    protected Group group;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getEntityName() {
        return entityName;
    }

    public void setEntityName(String entityName) {
        this.entityName = entityName;
    }

    public Group getGroup() {
        return group;<commit_msg>Change Constraint.group fetch type to LAZY #2065<commit_after>/*
 * Copyright (c) 2008-2016 Haulmont.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
package com.haulmont.cuba.security.entity;

import com.haulmont.cuba.core.entity.StandardEntity;
import com.haulmont.cuba.core.entity.annotation.SystemLevel;

import javax.persistence.*;

/**
 * Security constraint definition entity.
 */
@Entity(name = "sec$Constraint")
@Table(name = "SEC_CONSTRAINT")
@SystemLevel
public class Constraint extends StandardEntity {

    private static final long serialVersionUID = -8598548105315052474L;

    @Column(name = "CHECK_TYPE", length = 50, nullable = false)
    protected String checkType = ConstraintCheckType.DATABASE.getId();

    @Column(name = "OPERATION_TYPE", length = 50, nullable = false)
    protected String operationType = ConstraintOperationType.READ.getId();

    @Column(name = "CODE", length = 255)
    protected String code;

    @Column(name = "ENTITY_NAME", length = 255, nullable = false)
    protected String entityName;

    @Column(name = "JOIN_CLAUSE", length = 500)
    protected String joinClause;

    @Column(name = "WHERE_CLAUSE", length = 1000)
    protected String whereClause;

    @Lob
    @Column(name = "GROOVY_SCRIPT")
    protected String groovyScript;

    @Lob
    @Column(name = "FILTER_XML")
    protected String filterXml;

    @Column(name = "IS_ACTIVE")
    protected Boolean isActive = true;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "GROUP_ID")
    protected Group group;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getEntityName() {
        return entityName;
    }

    public void setEntityName(String entityName) {
        this.entityName = entityName;
    }

    public Group getGroup() {
        return group;
{'fraction_non_alphanumeric': 0.09664486178518675, 'fraction_numerical': 0.02110149820637265, 'mean_word_length': 3.5014245014245016, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4627785', 'n_tokens_mistral': 1457, 'n_tokens_neox': 1349, 'n_words': 430}