<commit_before>package com.bk.model;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.ManyToMany;

/**
 * @author <NAME>
 * Mar 15, 2013
 */

@Entity
public class Genre extends AbstractEntity {
	private String genre;

	@ManyToMany(mappedBy = "genres")
	private Set<Book> books = new HashSet<>();

	public String getGenre() {
		return genre;
	}

	public void setGenre(String genre) {
		this.genre = genre;
	}

	public void addBook(Book book) {
		this.books.add(book);
	}
	
	public Set<Book> getBooks() {
		return Collections.unmodifiableSet(books);
	}
}<commit_msg>Genre now non nullable and unique<commit_after>package com.bk.model;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;

/**
 * @author <NAME>
 * Mar 15, 2013
 */

@Entity
public class Genre extends AbstractEntity {

    @Column(nullable = false, unique = true)
	private String genre;

	@ManyToMany(mappedBy = "genres")
	private Set<Book> books = new HashSet<>();

	public String getGenre() {
		return genre;
	}

	public void setGenre(String genre) {
		this.genre = genre;
	}

	public void addBook(Book book) {
		this.books.add(book);
	}

	public Set<Book> getBooks() {
		return Collections.unmodifiableSet(books);
	}
}
{'fraction_non_alphanumeric': 0.12179487179487179, 'fraction_numerical': 0.008547008547008548, 'mean_word_length': 4.403846153846154, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '7542168', 'n_tokens_mistral': 501, 'n_tokens_neox': 469, 'n_words': 119}