Caused by: org.hibernate.MappingException: Foreign key (FKi3uxs48nod3arim7hhpwx1anb:role_group [app_group_id])) must have same number of columns as the referenced primary key (app_group [id, app_id, group_id])
< /code>
Ich habe die folgenden Tabellendefinitionen und Entitätskräfte: < /p>
App_Group Tabelle Erstellung: < /p>
create table app_group
(
id varchar(36) not null,
group_id varchar(36) not null,
app_id varchar(36) not null,
primary key (id),
unique (group_id, app_id),
constraint app_group_group_fk foreign key (group_id) references `group` (id),
constraint app_group_app_fk foreign key (app_id) references `app` (id)
);
< /code>
AppGroup JPA Entity: < /p>
@Entity
@Table(name = "app_group")
public class AppGroup implements Serializable {
@Id
@Size(min = 36, max = 36)
protected String id;
@ManyToOne
@JoinColumn(name = "app_id")
private App app;
@ManyToOne
@JoinColumn(name = "group_id")
private Group group;
@OneToMany(mappedBy = "appGroup", cascade = CascadeType.ALL, orphanRemoval = true)
private Set groupRoles = new HashSet();
}
< /code>
Rollengruppe Tabelle Erstellung: < /p>
create table role_group
(
id varchar(36) not null,
group_id varchar(36) not null,
role_id varchar(36) not null,
app_group_id varchar(36) not null,
primary key (id),
unique (group_id, role_id),
constraint role_group_group_fk foreign key (group_id) references `group` (id),
constraint role_group_role_fk foreign key (role_id) references `role` (id),
constraint role_group_app_group_fk foreign key (app_group_id) references `app_group` (id)
);
< /code>
Rollengruppe JPA Entity: < /p>
@Entity
@Table(name = "role_group")
@Accessors(fluent = true)
public class RoleGroup {
@Id
@Size(min = 36, max = 36)
protected String id;
@ManyToOne
@JoinColumn(name = "role_id")
private Role role;
@ManyToOne
@JoinColumn(name = "group_id")
private Group group;
@ManyToOne
@JoinColumn(name = "app_group_id")
private AppGroup appGroup;
}
Problem:
Die Tabelle app_group enthält eine primäre Schlüssel -ID und eine eindeutige Einschränkung (Group_id, app_id) , die gut funktionieren sollte. Das ist im Schema nicht der Fall. Und wie kann ich dieses Problem lösen?
Ich begegne einen Fehler, wenn ich versuche, Daten mit JPA und Hibernate zu speichern. Die Fehlermeldung lautet: < /p> [code]Caused by: org.hibernate.MappingException: Foreign key (FKi3uxs48nod3arim7hhpwx1anb:role_group [app_group_id])) must have same number of columns as the referenced primary key (app_group [id, app_id, group_id]) < /code> Ich habe die folgenden Tabellendefinitionen und Entitätskräfte: < /p> App_Group Tabelle Erstellung: < /p> create table app_group ( id varchar(36) not null, group_id varchar(36) not null, app_id varchar(36) not null, primary key (id), unique (group_id, app_id), constraint app_group_group_fk foreign key (group_id) references `group` (id), constraint app_group_app_fk foreign key (app_id) references `app` (id) ); < /code> AppGroup JPA Entity: < /p> @Entity @Table(name = "app_group") public class AppGroup implements Serializable { @Id @Size(min = 36, max = 36) protected String id;
@ManyToOne @JoinColumn(name = "role_id") private Role role;
@ManyToOne @JoinColumn(name = "group_id") private Group group;
@ManyToOne @JoinColumn(name = "app_group_id") private AppGroup appGroup; } [/code] Problem: Die Tabelle app_group enthält eine primäre Schlüssel -ID und eine eindeutige Einschränkung (Group_id, app_id) , die gut funktionieren sollte. Das ist im Schema nicht der Fall. Und wie kann ich dieses [url=viewtopic.php?t=20324]Problem[/url] lösen?
Ich begegne einen Fehler, wenn ich versuche, Daten mit JPA und Hibernate zu speichern. Die Fehlermeldung lautet:
Caused by: org.hibernate.MappingException: Foreign key...
Ich implementiere einen qualifizierten elektronischen Signature (QES) -Flow unter Verwendung von Swisscom Trust Services und IText 7.2.5 in Java. Ich stecke an dem Schritt fest, in dem ich den...
Ich versuche, jobspy zu installieren
pip install -U python-jobspy
Ich ende in der Schleife von Abhängigkeiten, die ständig ausfallen.
Successfully uninstalled pydantic-1.10.21
ERROR: pip's...
Ich versuche, den Spearman -Rang -Korrelationskoeffizienten zwischen zwei Ranglisten mit scipy.stats.spearmanr zu berechnen und manuell mit der Formel:
Ich arbeite mit OpenXML in C#, um Dokumente zu generieren, aber ich stere mir einen Fehler in der Konsolenmeldung : Reaktion inhaltslanger Nichtübereinstimmung: Zu wenige Bytes geschrieben (74 von...