package ru.openjudge.server.entity;

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

@Entity
@Table(name = "SUBMISSIONS")
public class Submission implements Serializable {

    private static final long serialVersionUID = -5547448500158392136L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "ID")
    private Long id;

    @ManyToOne
    @JoinColumn(name = "USER_ID", nullable = false)
    private User user;

    public Long getId() {
        return id;
    }

    private void setId(Long id) {
        this.id = id;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}

@@ -123,16 +123,90 @@
 ISSIONS%22
+,%0A        indexes = %7B@Index(columnList = %22USER_ID%22, name = %22user_id_idx%22)%7D
 )%0Apublic

index for Submission