Erstellung habe ich Klassen:Hibernate - Klassen von Schema
@Table(name = "FILE_SET")
@Entity
public class FileSet
{
@Id
@Column(name = "FileSetId")
private final long fileSetId;
@Column(name = "FileSetState")
private final int fileSetState;
@OneToMany(targetEntity = Variables.class)
private final Set<Variables> variables;
}
und
@Entity
@Table(name = "VARIABLES")
public class Variables
{
@Id
@Column(name = "VariablesId")
private final int variablesId;
@ManyToOne(targetEntity = FileSet.class)
@JoinColumn(name = "CurrentFileSetId")
private final long currentFileSetId;
@Column(name = "CurrentDevicesDictId")
private final long currentDevicesDictId;
}
Und dieser Code Kistenverpackungen Tabellen: https://zapodaj.net/b18d0afb396e5.png.html
Aber ich wollte nur "Variablen" haben und "FileSet", wobei CurrentFileSetId in Variablen der Fremdschlüssel von FileSet ist. Was mache ich falsch? Ich benutze den ersten Ruhezustand.
Der Fremdschlüsselspalt Name ist 'CurrentFileSetId'. –
@ v.ladynev korrigiert! – eatSleepCode