<commit_before>package net.safedata.spring.training.jpa.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedNativeQueries;
import javax.persistence.NamedNativeQuery;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import java.util.Objects;

@Entity(name = "Product")
@Table(
        name = "Product",
        //schema = "spring_training",
        uniqueConstraints = {
                @UniqueConstraint(name = "uniqueName", columnNames = "name")
        },
        indexes = {
                @Index(name = "nameIndex", columnList = "name")
        }
)
@NamedQueries({
        @NamedQuery(
                name = "Product.byStore",
                query = "SELECT product " +
                        "FROM Product product " +
                        "WHERE product.section.store.id = :storeId"
        ),

        @NamedQuery(
                name = "Product.getAll",
                query = "SELECT product " +
                        "FROM Product product"
        )
})
@NamedNativeQueries({
        @NamedNativeQuery(
                name = "Product.productById",
                query = "SELECT * " +
                        "FROM Product p " +
                        "WHERE p.id = :productId"
        )
})
public class Product extends AbstractEntity {

    @Id
    @Column(name = "id")
    @GeneratedValue(generator = "product_sequence_generator")
    @SequenceGenerator(name = "product_sequence_generator", sequenceName = "product_sequence", allocationSize = 1)
    private int id;

    @Column(name = "name", unique = true, nullable = false, insertable = true, updatable = false, length = 50)
    private String name;

    @Column(name = "price", unique = false, nullable = false, insertable = true, updatable = true, length = 10)
    private double price;

    @ManyToOne(targetEntity = Section.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    @JoinColumn(name = "sectionId")
    private Section section;

    public Product() {}<commit_msg>[improve] Made the default constructor public<commit_after>package net.safedata.spring.training.jpa.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedNativeQueries;
import javax.persistence.NamedNativeQuery;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import java.util.Objects;

@Entity(name = "Product")
@Table(
        name = "Product",
        //schema = "spring_training",
        uniqueConstraints = {
                @UniqueConstraint(name = "uniqueName", columnNames = "name")
        },
        indexes = {
                @Index(name = "nameIndex", columnList = "name")
        }
)
@NamedQueries({
        @NamedQuery(
                name = "Product.byStore",
                query = "SELECT product " +
                        "FROM Product product " +
                        "WHERE product.section.store.id = :storeId"
        ),

        @NamedQuery(
                name = "Product.getAll",
                query = "SELECT product " +
                        "FROM Product product"
        )
})
@NamedNativeQueries({
        @NamedNativeQuery(
                name = "Product.productById",
                query = "SELECT * " +
                        "FROM Product p " +
                        "WHERE p.id = :productId"
        )
})
public class Product extends AbstractEntity {

    @Id
    @Column(name = "id")
    @GeneratedValue(generator = "product_sequence_generator")
    @SequenceGenerator(name = "product_sequence_generator", sequenceName = "product_sequence", allocationSize = 1)
    private int id;

    @Column(name = "name", unique = true, nullable = false, insertable = true, updatable = false, length = 50)
    private String name;

    @Column(name = "price", unique = false, nullable = false, insertable = true, updatable = true, length = 10)
    private double price;

    @ManyToOne(targetEntity = Section.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL)
    @JoinColumn(name = "sectionId")
    private Section section;

    protected Product() {}
{'fraction_non_alphanumeric': 0.10623841877702285, 'fraction_numerical': 0.0020588840848260242, 'mean_word_length': 2.6416791604197902, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1377151', 'n_tokens_mistral': 1316, 'n_tokens_neox': 1284, 'n_words': 303}