<commit_before>package org.example.seed.entity;

import lombok.AccessLevel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Setter;
import org.example.seed.catalog.ChefStatus;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.List;

/**
 * Created by PINA on 24/06/2017.
 */
@Data
@Entity
@Table(name = "chef")
@SQLDelete(sql = "UPDATE chef SET deleted = 1 WHERE id = ?")
@Where(clause = "deleted <> 1")
@EqualsAndHashCode(callSuper = true)
public class ChefEntity extends DatesEntity {

    @Id
    @Column(name = "id", length = 36, nullable = false, updatable = false)
    private String id;

    @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
    @JoinColumn(name = "fk_id_account")
    private AccountEntity account;

    @Setter(AccessLevel.NONE)
    @OneToMany(mappedBy = "chef")
    private List<TelephoneEntity> telephones;

    @Column(name = "curp", length = 18)
    private String curp;

    @Column(name = "rfc", length = 13)
    private String rfc;

    @Column(name = "rating")
    private Float rating;

    @Column(name = "status", length = 20)
    @Enumerated(EnumType.STRING)
    private ChefStatus status;

    @Column(name = "deleted")
    private boolean deleted;
}<commit_msg>feat(entity): change OneToMany mapping with cascade all property<commit_after>package org.example.seed.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.example.seed.catalog.ChefStatus;
import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

import javax.persistence.*;
import java.util.List;

/**
 * Created by PINA on 24/06/2017.
 */
@Data
@Entity
@Table(name = "chef")
@SQLDelete(sql = "UPDATE chef SET deleted = 1 WHERE id = ?")
@Where(clause = "deleted <> 1")
@EqualsAndHashCode(callSuper = true)
public class ChefEntity extends DatesEntity {

    @Id
    @Column(name = "id", length = 36, nullable = false, updatable = false)
    private String id;

    @OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    @JoinColumn(name = "fk_id_account")
    private AccountEntity account;

    @OneToMany(mappedBy = "chef", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
    @Fetch(FetchMode.SELECT)
    private List<TelephoneEntity> telephones;

    @Column(name = "curp", length = 18)
    private String curp;

    @Column(name = "rfc", length = 13)
    private String rfc;

    @Column(name = "rating")
    private Float rating;

    @Column(name = "status", length = 20)
    @Enumerated(EnumType.STRING)
    private ChefStatus status;

    @Column(name = "deleted")
    private boolean deleted;
}
{'fraction_non_alphanumeric': 0.1218109953287819, 'fraction_numerical': 0.012935680919870643, 'mean_word_length': 4.184357541899441, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1082283', 'n_tokens_mistral': 964, 'n_tokens_neox': 887, 'n_words': 225}