<commit_before>package de.rwth.idsg.velocity.domain;

import de.rwth.idsg.velocity.domain.login.User;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.Type;
import org.joda.time.LocalDate;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Set;


@Entity
@DiscriminatorValue("customer")
@Table(name="T_CUSTOMER",
        indexes = {
                @Index(columnList="address_id", unique = true) })
@EqualsAndHashCode(of = {"customerId"}, callSuper = false)
@ToString(includeFieldNames = true)
public class Customer extends User implements Serializable {

    @Column(name = "customer_id")
    @Getter @Setter
    private String customerId;

    @Column(name = "card_id")
    @Getter @Setter
    private String cardId;

    @Column(name = "first_name")
    @Getter @Setter
    private String firstname;

    @Column(name = "last_name")
    @Getter @Setter
    private String lastname;

    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "address_id")
    @Getter @Setter
    private Address address;

    @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalDate")
    @Column(name = "birthday")
    @Getter @Setter
    private LocalDate birthday;

    @Column(name = "mail_address")
    @Getter @Setter
    private String mailAddress;

    @Column(name = "is_activated")
    @Getter @Setter
    private Boolean isActivated;

    @Column(name = "in_transaction")
    @Getter @Setter
    private Boolean inTransaction;

    @Column(name = "card_pin")
    @Getter @Setter
    private Integer cardPin;

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "customer", orphanRemoval = true)
    @Getter @Setter
    private Set<Transaction> transactions;

}<commit_msg>update: customer is initially not in transaction<commit_after>package de.rwth.idsg.velocity.domain;

import de.rwth.idsg.velocity.domain.login.User;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.Type;
import org.joda.time.LocalDate;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Set;


@Entity
@DiscriminatorValue("customer")
@Table(name="T_CUSTOMER",
        indexes = {
                @Index(columnList="address_id", unique = true) })
@EqualsAndHashCode(of = {"customerId"}, callSuper = false)
@ToString(includeFieldNames = true)
public class Customer extends User implements Serializable {

    @Column(name = "customer_id")
    @Getter @Setter
    private String customerId;

    @Column(name = "card_id")
    @Getter @Setter
    private String cardId;

    @Column(name = "first_name")
    @Getter @Setter
    private String firstname;

    @Column(name = "last_name")
    @Getter @Setter
    private String lastname;

    @OneToOne(cascade = CascadeType.ALL)
    @JoinColumn(name = "address_id")
    @Getter @Setter
    private Address address;

    @Type(type = "org.jadira.usertype.dateandtime.joda.PersistentLocalDate")
    @Column(name = "birthday")
    @Getter @Setter
    private LocalDate birthday;

    @Column(name = "mail_address")
    @Getter @Setter
    private String mailAddress;

    @Column(name = "is_activated")
    @Getter @Setter
    private Boolean isActivated;

    @Column(name = "in_transaction")
    @Getter @Setter
    private Boolean inTransaction;

    @Column(name = "card_pin")
    @Getter @Setter
    private Integer cardPin;

    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "customer", orphanRemoval = true)
    @Getter @Setter
    private Set<Transaction> transactions;

    @PrePersist
    public void prePersist() {
        if (inTransaction == null) {
            inTransaction = false;
        }
    }

}
{'fraction_non_alphanumeric': 0.11154752553024352, 'fraction_numerical': 0.0, 'mean_word_length': 3.79297365119197, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '977298', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1188, 'n_words': 273}