<commit_before>package fr.openwide.core.hibernate.security.business.person.model;

import java.util.Date;
import java.util.LinkedHashSet;
import java.util.Locale;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.MappedSuperclass;
import javax.persistence.OrderBy;
import javax.persistence.Transient;

import org.bindgen.Bindable;
import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.Index;
import org.hibernate.search.annotations.Analyzer;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;

import fr.openwide.core.commons.util.CloneUtils;
import fr.openwide.core.hibernate.business.generic.model.GenericEntity;
import fr.openwide.core.hibernate.search.util.HibernateSearchAnalyzer;
import fr.openwide.core.hibernate.security.business.authority.model.Authority;

@MappedSuperclass
@Bindable
public abstract class AbstractPerson<P extends AbstractPerson<P>> extends GenericEntity<Integer, P>
		implements Person {

	private static final long serialVersionUID = 1803671157183603979L;
	
	@Id
	@GeneratedValue
	@DocumentId
	private Integer id;
	
	@Column(nullable = false, unique = true)
	@Index(name = "idx_person_userName")
	@Field(analyzer = @Analyzer(definition = HibernateSearchAnalyzer.TEXT))
	private String userName;
	<commit_msg>en fait Oracle crée aussi un index avec le unique, comme PostgreSQL donc on peut supprimer cet index<commit_after>package fr.openwide.core.hibernate.security.business.person.model;

import java.util.Date;
import java.util.LinkedHashSet;
import java.util.Locale;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.MappedSuperclass;
import javax.persistence.OrderBy;
import javax.persistence.Transient;

import org.bindgen.Bindable;
import org.hibernate.annotations.Cascade;
import org.hibernate.search.annotations.Analyzer;
import org.hibernate.search.annotations.DocumentId;
import org.hibernate.search.annotations.Field;

import fr.openwide.core.commons.util.CloneUtils;
import fr.openwide.core.hibernate.business.generic.model.GenericEntity;
import fr.openwide.core.hibernate.search.util.HibernateSearchAnalyzer;
import fr.openwide.core.hibernate.security.business.authority.model.Authority;

@MappedSuperclass
@Bindable
public abstract class AbstractPerson<P extends AbstractPerson<P>> extends GenericEntity<Integer, P>
		implements Person {

	private static final long serialVersionUID = 1803671157183603979L;
	
	@Id
	@GeneratedValue
	@DocumentId
	private Integer id;
	
	@Column(nullable = false, unique = true)
	@Field(analyzer = @Analyzer(definition = HibernateSearchAnalyzer.TEXT))
	private String userName;
	
{'fraction_non_alphanumeric': 0.09216430790472903, 'fraction_numerical': 0.013117017604418364, 'mean_word_length': 6.606299212598425, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '7398116', 'n_tokens_mistral': 903, 'n_tokens_neox': 845, 'n_words': 175}