<commit_before>package se.kth.csc.model;

import com.fasterxml.jackson.annotation.JsonView;
import com.google.common.collect.Sets;

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

@Entity
@Table(name = "queue")
public class Queue {
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    @Column(name = "id", updatable = false)
    private int id;

    @Column(name = "name", unique = true)
    private String name;

    @ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.DETACH, CascadeType.MERGE, CascadeType.REFRESH, CascadeType.PERSIST})
    @JoinTable(name = "account_queue",
            joinColumns =
            @JoinColumn(name = "queue_id", referencedColumnName = "id"),
            inverseJoinColumns =
            @JoinColumn(name = "account_id", referencedColumnName = "id"))
    private Set<Account> owners = Sets.newHashSet();


    @ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.DETACH, CascadeType.MERGE, CascadeType.REFRESH, CascadeType.PERSIST})
    @JoinTable(name = "moderator_queue",
            joinColumns =
            @JoinColumn(name = "queue_id", referencedColumnName = "id"),
            inverseJoinColumns =
            @JoinColumn(name = "account_id", referencedColumnName = "id"))
    private Set<Account> moderators = Sets.newHashSet();

    @OneToMany(fetch = FetchType.EAGER, mappedBy = "queue", cascade = CascadeType.ALL)
    private Set<QueuePosition> positions = Sets.newHashSet();

    @Column(name = "active")
    private boolean active;

    @Column(name = "locked")
    private boolean locked;

    public boolean isActive () {
        return active;
    }

    public void setActive (boolean active) {
        this.active = active;
    }

    public boolean isLocked () {
        return locked;
    }

    public void setLocked (boolean locked) {
        this.locked = locked;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }<commit_msg>Change positions to LinkedHashSet for predictable iteration order<commit_after>package se.kth.csc.model;

import com.fasterxml.jackson.annotation.JsonView;
import com.google.common.collect.Sets;

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

@Entity
@Table(name = "queue")
public class Queue {
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    @Column(name = "id", updatable = false)
    private int id;

    @Column(name = "name", unique = true)
    private String name;

    @ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.DETACH, CascadeType.MERGE, CascadeType.REFRESH, CascadeType.PERSIST})
    @JoinTable(name = "account_queue",
            joinColumns =
            @JoinColumn(name = "queue_id", referencedColumnName = "id"),
            inverseJoinColumns =
            @JoinColumn(name = "account_id", referencedColumnName = "id"))
    private Set<Account> owners = Sets.newHashSet();


    @ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.DETACH, CascadeType.MERGE, CascadeType.REFRESH, CascadeType.PERSIST})
    @JoinTable(name = "moderator_queue",
            joinColumns =
            @JoinColumn(name = "queue_id", referencedColumnName = "id"),
            inverseJoinColumns =
            @JoinColumn(name = "account_id", referencedColumnName = "id"))
    private Set<Account> moderators = Sets.newHashSet();

    @OneToMany(fetch = FetchType.EAGER, mappedBy = "queue", cascade = CascadeType.ALL)
    private Set<QueuePosition> positions = Sets.newLinkedHashSet();

    @Column(name = "active")
    private boolean active;

    @Column(name = "locked")
    private boolean locked;

    public boolean isActive () {
        return active;
    }

    public void setActive (boolean active) {
        this.active = active;
    }

    public boolean isLocked () {
        return locked;
    }

    public void setLocked (boolean locked) {
        this.locked = locked;
    }

    public int getId() {
        return id;
    }

    public String getName() {
        return name;
    }
{'fraction_non_alphanumeric': 0.11387369467926405, 'fraction_numerical': 0.0, 'mean_word_length': 3.039156626506024, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '661609', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1189, 'n_words': 273}