Questions tagged [many-to-many]

A type of relationship between entities of types A and B which associates a list of entities of type B to an entity of type A and vice versa. Types A and B may be the same type.

A type of relationship between entities of types A and B which associates a list of entities of type B to an entity of type A and vice versa. Types A and B may be the same type.

8687 questions
2
votes
0 answers

Sequelize: Using include for a joined table

I have 4 models: User, Skill, SkillToLearn, and SkillToTeach. The SkillToLearn and SkillToTeach contain two columns userId and skillId to keep track of a skill (given by skillId) that a user (given by userId) wants to learn or teach. My goal is to…
Truc Ly Le
  • 21
  • 2
2
votes
3 answers

django.db.utils.DatabaseError: ORA-00904: invalid identifier

I'm running an application on django 1.11 and as an Oracle Database 11G XE database engine. I have 3 tables producto, catalogo and catalogo_producto. The catalogo_producto table is an intermediate table between producto and catalogo. When making the…
scafrs
  • 443
  • 8
  • 20
2
votes
1 answer

symfony many to many in embedded form

I have a problem with embbed form from Model which has many to many relation. The embedded form will save the model correctly but will not save many to many relations. Example: Schema.yml: Mother: columns: name: type: string(80) Color: …
Charles
  • 11,367
  • 10
  • 77
  • 114
2
votes
0 answers

@Manytomany add extra field with no join Entity

I created a @ManyToMany relation between two table, without have a relational entity through them. Something like this: @Entity public class Category{ @Id @GeneratedValue(strategy = IDENTITY) @Column(name = "CATEGORY_ID", unique = true, nullable =…
Davide
  • 602
  • 7
  • 18
2
votes
2 answers

Many-to-Many with ECTO and put_assoc/4

I try associate 2 existing Many-to-Many records with ECTO and put_assoc/4 but won't remove elements when try update. Basically i have projects and users . for manage the access of users to projects i have the table "user_project". def Project do …
Nuno_Coletiv
  • 367
  • 3
  • 16
2
votes
2 answers

SQL - Many to Many alternatives?

Suppose I have records: ======= ========= Element id ======= ========= "H" "O" And another like: ======== == Compound id ======== == "Water" With: ======== == =========== ========== ========== Relation id compound_id…
c z
  • 7,726
  • 3
  • 46
  • 59
2
votes
0 answers

Laravel 5 polymorphic many-to-many relations where there are multiple such relationships in one model

Simplify database with polymorphic many to many relations where there are multiple such relations in the same model. For example, the user model might have polymorphic relations to user_types, user_roles, user_statuses tables. Each of these tables…
LarryTX
  • 197
  • 2
  • 12
2
votes
0 answers

Incremental ETL on code first many-to-many association table

I'm setting up a data warehouse (in SQL Server) together with our engineers we got almost everything up and running. Our main application also uses SQL Server as backend, and aims to be code first while using the entity framework. In most tables we…
dherre65
  • 343
  • 1
  • 2
  • 8
2
votes
1 answer

Insert new record in pivot table with many to many relationship using Entity Framework Core

I am building an application using ASP.NET Core MVC. I am trying to insert a new record with a many-to-many relationship. I have 3 tables Repairs, Parts and RepairParts. How can I insert the RepairId and PartId into the RepairParts table? Does EF…
FenrisL
  • 287
  • 5
  • 17
2
votes
1 answer

Querying a many-to-many collection or how to include a many-to-many table in a criteria query?

I am quite new to the world of NHibernate and I can't seem to get this to work with the use of a criteria query: query a many-to-many relationship or query a collection (set/bag) on an entity. I've searched the internet and checked all the…
TedOnTheNet
  • 1,082
  • 1
  • 8
  • 23
2
votes
1 answer

Rails filter join table during query

I have the following query which I would like to know how to execute in Rails 5 SELECT users.id, users.first_name, users.last_name, users.image, users.email, memberships.staff FROM users LEFT JOIN memberships ON memberships.shop_id = 1 WHERE…
Ruegen
  • 605
  • 9
  • 35
2
votes
1 answer

.net core EF core Many to many insert

public class Article { [Key] public int Id { get; set; } [Required] public string Title { get; set; } [Required] public string Lead { get; set; } [Required] public string Content { get; set; } [Required] …
ilovekittens
  • 75
  • 1
  • 6
2
votes
1 answer

ManyToMany models relationship Django

I have two models: class University(models.Model): name = models.CharField(max_length=50) address = models.CharField(max_length=50, null=True, blank=True) city = models.CharField(max_length=30, null=True, blank=True) country =…
gagro
  • 371
  • 7
  • 18
2
votes
0 answers

DELETE statement on table 'subs' expected to delete 1 row(s); Only 2 were matched

I'm using Flask-SQLAlchemy with many to many relationship. And i try to remove current user from users but i only receive en error like shown in a subject. What i'm doing wrong i couldn't understand. Thanks in advance for your help My models…
J_log
  • 223
  • 1
  • 3
  • 12
2
votes
1 answer

How to join table with multiple columns - spring jpa @manytomany three join columns java

I've come to a problem, where i have to a user which can be registered in multiple companies. Those companies can have registered multiple products. And user should be aware to which products in which companies he has rights. This is my solution so…