package com.sajo.teamkerbell.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

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

/**
 * Created by seongahjo on 2016. 2. 29..
 */

@Data
@Entity
@Table(name = "roles")
@EqualsAndHashCode(exclude = {"userRoles"})
public class Role implements Serializable {
    private static final long serialVersionUID = -24282248985360532L;
    @Id
    @GeneratedValue
    private Integer id;

    private String userRole;

    public Role() {
    }

    @OneToMany(cascade = CascadeType.ALL)
    @JoinTable(name = "user_roles",
            joinColumns = {@JoinColumn(name = "role_id", referencedColumnName = "id")},
            inverseJoinColumns = {@JoinColumn(name = "useridx")}
    )
    private Set<User> userRoles;

    public Role(String role) {
        this.userRole = role;
    }
}
@@ -649,15 +649,14 @@
  = %22
-role_id
+ROLEID
 %22, r
@@ -743,15 +743,14 @@
  = %22
-useridx
+USERID
 %22)%7D%0A

Fix Role cascade bug