<commit_before>package fr.openwide.core.basicapp.core.business.user.model;

import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OrderBy;

import org.bindgen.Bindable;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.Type;
import org.hibernate.search.annotations.Analyzer;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;

import com.google.common.collect.Lists;

import fr.openwide.core.jpa.business.generic.model.GenericEntity;
import fr.openwide.core.jpa.search.util.HibernateSearchAnalyzer;
import fr.openwide.core.jpa.security.business.authority.model.Authority;
import fr.openwide.core.jpa.security.business.person.model.IPersonGroup;

@Entity
@Indexed
@Bindable
public class UserGroup extends GenericEntity<Long, UserGroup> implements IPersonGroup {
	private static final long serialVersionUID = 2156717229285615454L;

	@Id
	@GeneratedValue
	@DocumentId
	private Long id;

	@Field(analyzer = @Analyzer(definition = HibernateSearchAnalyzer.TEXT))
	private String name;

	@JsonIgnore
	@ManyToMany(mappedBy = "userGroups")
	@OrderBy("lastName, firstName")
	private List<User> persons = Lists.newLinkedList();

	@JsonIgnore
	@ManyToMany
	@OrderBy("name")
	private Set<Authority> authorities = new LinkedHashSet<Authority>();

	@Type(type = "org.hibernate.type.StringClobType")
	private String description;

	@Column(nullable = false)
	private Boolean locked = false;

	public UserGroup() {
	}

	public UserGroup(String name) {
		super();
		
		setName(name);
	}

	@Override
	public Long getId() {
		return id;
	}

	@Override
	public void setId(Long id) {
		this.id = id;
	}

	@Override
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<User> getPersons() {
		return persons;
	}

	public void setPersons(List<User> persons) {
		this.persons = persons;
	}

	@Override
	public String getDisplayName() {
		return this.getName();
	}

	@Override
	public Set<Authority> getAuthorities() {
		return authorities;
	}

	public void setAuthorities(Set<Authority> authorities) {
		this.authorities = authorities;
	}

	public void addAuthority(Authority authority) {
		this.authorities.add(authority);
	}

	public void removeAuthority(Authority authority) {
		this.authorities.remove(authority);
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Boolean getLocked() {
		return locked;
	}

	public void setLocked(boolean locked) {
		this.locked = locked;
	}

	@Override
	public int compareTo(UserGroup group) {
		if (this == group) {
			return 0;
		}
		return DEFAULT_STRING_COLLATOR.compare(this.getName(), group.getName());
	}

	@Override
	public String getNameForToString() {
		return getName();
	}
}<commit_msg>il faut utiliser un Boolean avec un grand B si on veut pouvoir injecter la valeur via Spring<commit_after>package fr.openwide.core.basicapp.core.business.user.model;

import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.OrderBy;

import org.bindgen.Bindable;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.hibernate.annotations.Type;
import org.hibernate.search.annotations.Analyzer;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;
import org.hibernate.search.annotations.Indexed;

import com.google.common.collect.Lists;

import fr.openwide.core.jpa.business.generic.model.GenericEntity;
import fr.openwide.core.jpa.search.util.HibernateSearchAnalyzer;
import fr.openwide.core.jpa.security.business.authority.model.Authority;
import fr.openwide.core.jpa.security.business.person.model.IPersonGroup;

@Entity
@Indexed
@Bindable
public class UserGroup extends GenericEntity<Long, UserGroup> implements IPersonGroup {
	private static final long serialVersionUID = 2156717229285615454L;

	@Id
	@GeneratedValue
	@DocumentId
	private Long id;

	@Field(analyzer = @Analyzer(definition = HibernateSearchAnalyzer.TEXT))
	private String name;

	@JsonIgnore
	@ManyToMany(mappedBy = "userGroups")
	@OrderBy("lastName, firstName")
	private List<User> persons = Lists.newLinkedList();

	@JsonIgnore
	@ManyToMany
	@OrderBy("name")
	private Set<Authority> authorities = new LinkedHashSet<Authority>();

	@Type(type = "org.hibernate.type.StringClobType")
	private String description;

	@Column(nullable = false)
	private Boolean locked = false;

	public UserGroup() {
	}

	public UserGroup(String name) {
		super();
		
		setName(name);
	}

	@Override
	public Long getId() {
		return id;
	}

	@Override
	public void setId(Long id) {
		this.id = id;
	}

	@Override
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<User> getPersons() {
		return persons;
	}

	public void setPersons(List<User> persons) {
		this.persons = persons;
	}

	@Override
	public String getDisplayName() {
		return this.getName();
	}

	@Override
	public Set<Authority> getAuthorities() {
		return authorities;
	}

	public void setAuthorities(Set<Authority> authorities) {
		this.authorities = authorities;
	}

	public void addAuthority(Authority authority) {
		this.authorities.add(authority);
	}

	public void removeAuthority(Authority authority) {
		this.authorities.remove(authority);
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Boolean getLocked() {
		return locked;
	}

	public void setLocked(Boolean locked) {
		this.locked = locked;
	}

	@Override
	public int compareTo(UserGroup group) {
		if (this == group) {
			return 0;
		}
		return DEFAULT_STRING_COLLATOR.compare(this.getName(), group.getName());
	}

	@Override
	public String getNameForToString() {
		return getName();
	}
}
{'fraction_non_alphanumeric': 0.1067548417572036, 'fraction_numerical': 0.00629822075263738, 'mean_word_length': 5.061068702290076, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '7666524', 'n_tokens_mistral': 2152, 'n_tokens_neox': 2007, 'n_words': 443}