@Entity
@Table(name = TABLE)
public class TaskResults {
public static final String TABLE = "taskresults";
public static final String RESULT_ID = "taskresultid";
public static final String INDEX_VALUE = "qualityindexvalue";
@Id
@Column(name = TASK_RESULT_ID)
@GeneratedValue(strategy = IDENTITY)
private Long TaskResultId;
@ManyToOne(cascade = CascadeType.DETACH)
@JoinColumn(name = TASK_ID)
@JsonBackReference
private Task Task;
@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name = INDEX_CODE)
private Indexes Index;
@Column(name = INDEX_VALUE)
private Float IndexValue;
@Entity
@Table(name = TABLE)
public class Indexes {
public static final String TABLE = "DICT_indexes";
public static final String INDEX_CODE = "indexcode";
public static final String INDEX_NAME = "indexname";
public static final String UNIT = "Unit";
@Id
@Column(name =INDEX_CODE, nullable = false)
private Long IndexId;
@ManyToOne
@JoinColumn(name = INDEX_TYPE_CODE, nullable = false)
private IndexTypes IndexType;
@Column(name = INDEX_NAME, length = 100)
private String IndexName;
@ManyToOne
@JoinColumn(name = Units.UNIT_ID)
private Units unit;
И все будет работать ?