many-to-many

EF 4.1 Multiple Many to Many relationships in single class

旧城冷巷雨未停 提交于 2019-12-11 07:39:31
问题 I have a class with multiple many to many relationships mapping to the same secondary class. My EquipmentSet class has two arrays of Equipment objects, and the Equipment class also has an array of EquipmentSets to determine which sets the equipment is a part of. EF is only generating a lookup table for the second Many to Many relationship. How can I tell EF to generate lookup tables for both? When the code below is used, only the table "ModelSpecificEquipment" is generated. The table

Database table naming; name_verb_name conventions for many-to-many intersect tables

a 夏天 提交于 2019-12-11 07:39:31
问题 I've read around on SO for other questions on the subject, and I'm aware that naming conventions are an often subjective topic, however I feel this is less general ( and less inquired about ) than PascalCase versus under_scores . Given a simple commerce system, with User and Product entities; a given user can purchase items, and the transaction records are stored in a User_Product table. ( sure, Purchase is more semantic, but just follow me here ) Anyways, if I were to introduce the ability

South migrations and changes to many-to-may fields

牧云@^-^@ 提交于 2019-12-11 07:32:01
问题 I was working on an app that is supposed to send newsletters to customers. I had a model defined like this from django.auth.models import User class Newsletter(models.Model): owner = models.ForeignKey(User, related_name='+', blank=False) sent = models.BooleanField(default=False) date_created = models.DateTimeField(auto_now_add=True) date_sent = models.DateTimeField(null=True) subject = models.CharField(max_length=255) content = HTMLField() recipients = models.ManyToManyField(User, related

Entity Framework 4.0 - EF - maps many-to-many relationships too well in the diagram

空扰寡人 提交于 2019-12-11 07:11:31
问题 Sorry I don't speak EF lingo that well, having just set up my first EF project. I'm used to working with Linq-to-SQL as a way of avoiding SQL queries, and it worked well with some WCF web services I used. All this in Microsoft Visual Studio 2010. Now with that background, I created a database using Servr that has Tables A and B in a many to many relationship with Table C. Since it is illegal to do this in database theory, I set up a linking table, as is well known. Two of them: one called A_C

Adding properties to many to many relationship?

笑着哭i 提交于 2019-12-11 07:08:46
问题 I have been using Core Data to model my database. I have 2 entities that are in many to many relationship. Each person can have many addresses, and on each address multiple persons can live. Now i would like to add property to this relationship. For example one person - address will have label home, other person - address can will have label mama's place. I can't add this property on address entity, because same address will have different labels for different persons. Since relationships are

JPA join fetch query with many to many

一个人想着一个人 提交于 2019-12-11 07:08:28
问题 I have an object Favourite. This object has a many to many connection with Colors. Lets say that some favourites have many colors, 2-3 etc. When I search for a favourite like: SELECT fav FROM Favourite fav join fetch fav.colors as cl WHERE fav.name = "blabla" . The resulting object contains all the colors related to this favourite. My problem is when I want to search for a favourite that has a certain color. For example: SELECT fav FROM Favourite fav join fetch fav.colors as cl WHERE cl.name

Storing dynamic properties of objects in SQL [duplicate]

允我心安 提交于 2019-12-11 06:57:47
问题 This question already has answers here : Dynamic table columns based on user preferences (2 answers) Closed 5 years ago . I am trying to store "dynamic" properties about objects in SQL. As an example, let's say I have a table called objs that has two columns ( id , name ). Now some users may want to store a property called hocus while others may want to store a property called pocus (or even banana ). Anything really. My thought is to create two tables, props and obj_props . props would have

How to get full data from many to many relationship in firebase db android?

邮差的信 提交于 2019-12-11 06:52:40
问题 I have a class which is part of a school and this class has teachers and students, all of them has name and maybe has phone number , I want to get the full data for the classes but firstly, could you advice me, what is the best for performance and maintaining from the following Dbs : 1st one "schools":{ "school1":{ "class1":{ "name":"SC1", "teachers":[{ "name":"T1" }, { "name":"T2" }], "students":[ {"name":"S1"}, {"name":"S2"} ] } } . . . . . . . } and the 2nd "school":{ "school1":{ "name":

Views in a has_many :through relationship

陌路散爱 提交于 2019-12-11 06:38:36
问题 I've been tinkering with this for some time now, and can't seem to figure this out. It's probably something simple, but here goes: I have a has_many :trough relationship between 'laminate', and 'standards' with a joined model 'standardization'. Standard.rb class Standard < ActiveRecord::Base attr_accessible :description, :name has_many :standardizations has_many :laminates, :through => :standardizations end Standardization.rb class Standardization < ActiveRecord::Base attr_accessible

JPA update doesn't work in a many-to-many relationship

久未见 提交于 2019-12-11 06:34:16
问题 I have 3 tables: customer(idCustomer,...) is_managed(idCustomer,idPerson) sales_person(idPerson,...) There is a @ManyToMany relation between customer and sales_person . When I perform a delete, then it works fine: the customer , is_managed and sales_person are deleted. But when I perform an update, then the customer and is_managed are updated, but the sales_person not. For example, if I update a customer by deleting the sales_person , it's deleted in is_managed table, but not in sales_person