entity-relationship

Entity Relationship Diagram. How does the IS A relationship translate into tables?

我的梦境 提交于 2019-12-09 08:28:42
问题 I was simply wondering, how an ISA relationship in an ER diagram would translate into tables in a database. Would there be 3 tables? One for person, one for student, and one for Teacher? Or would there be 2 tables? One for student, and one for teacher, with each entity having the attributes of person + their own? Or would there be one table with all 4 attributes and some of the squares in the table being null depending on whether it was a student or teacher in the row? NOTE: I forgot to add

Getting Error 3007 when I add my Entity Model

倾然丶 夕夏残阳落幕 提交于 2019-12-08 23:58:14
问题 I am getting an error 3007 when I add my entity model to my solution. I found these links: Good explination Short answer About this error: Error 1 Error 3007: Problem in Mapping Fragments starting at lines 89, 94: Non-Primary-Key column(s) [Person_ID] are being mapped in both fragments to different conceptual side properties - data inconsistency is possible because the corresponding conceptual side properties can be independently modified. Their Answer: I agree with their conclusion that by

unify two models (edmx) with visual studio 2010

孤人 提交于 2019-12-08 11:14:32
Hello as actually as i know you can not make relations between tow models or have in one models entities from two databases, it's a posibility two join two models both of them with existig databases behind? or there is some experience with a method like: move entities from the designer of one of them to the other and some bcp (SQL server) magic to move data and recreation on only one database? Thanks. As I know the answer is: No you can't join models targeting different databases and you can't place entities from multiple databases in single model. However you should be able to make relations

Relationship between Customer and Order in a Shopping Cart

走远了吗. 提交于 2019-12-08 08:10:19
问题 I'm making an ERD, so that I can build my shopping cart. I am confused about the relationship between Order and Customer. If im not mistaken, a customer can order many products, an order can be placed by 1 customer So Create Table OrderProduct( orderProductId int PRIMARY KEY, productID int, Quantity int ) Create Table Orders( OrderId int PRIMARY KEY, orderProductId int, //foregin key CustomerId int, date ) Am I correct, or is mu table structure wrong? 回答1: That seems fine to me, but you need

EF Code First Fluent API - Cascade Delete

一世执手 提交于 2019-12-08 05:06:37
问题 I have two models: public class User { ..... public virtual UserProfile UserProfile { get; set;} } public class UserProfile { ..... public virtual User User { get; set;} } The User is the master table and the relation is one to one. One user has only one UserProfile. How can I define the relationship between User and UserProfile using EF CodeFirst Fluent API in such a way that when I delete one user from User table the user profile from Userprofile is also deleted? 回答1: Use

unify two models (edmx) with visual studio 2010

左心房为你撑大大i 提交于 2019-12-08 04:34:25
问题 Hello as actually as i know you can not make relations between tow models or have in one models entities from two databases, it's a posibility two join two models both of them with existig databases behind? or there is some experience with a method like: move entities from the designer of one of them to the other and some bcp (SQL server) magic to move data and recreation on only one database? Thanks. 回答1: As I know the answer is: No you can't join models targeting different databases and you

objectify-appengine - Embedded class - not a supported property type

夙愿已清 提交于 2019-12-08 02:27:04
问题 I am trying out the objectify(version 2.2.3) embedded classes example (wiki) on google app engine. I am getting this error: java.lang.IllegalArgumentException: one: com.mypkg.LevelOne is not a supported property type. at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedSingleValue(DataTypeUtils.java:184) The code I have is the same as the one in Wiki. The section in the controller: EntityWithEmbedded ent = new EntityWithEmbedded(); ent.one = new LevelOne(); ent.one.foo = "Foo

How can i add extra column to third table in Entity Framework?

半腔热情 提交于 2019-12-08 02:06:11
问题 Assume i have two entities, User and Notification : public class User { [Key] public int UserId { get; set; } // other public properties // Navigation Properties public virtual ICollection<Notification> Notifications { get; set; } } public class Notification { [Key] public int NotificationId { get; set; } // other public properties // Navigation Properties public virtual ICollection<User> Users { get; set; } } I'm simply adding many-to-many Relationship like this: modelBuilder.Entity<User>()

Implementing super-type subtype correctly in MySQL

心不动则不痛 提交于 2019-12-07 18:14:29
问题 Below is a diagram of a database in which I am trying to determine the appropriate design for. Here are a few notes. Employees/managers are associated with customers. The partyid is a way to globally represent a person; customer, employee, manager. Does it need to propagate all the way down? Should it be a primary key in all tables or just the tables that represent an individual? Do the other tables such as billing , reporting , credential , etc tables need to have their own respective id's

C# Entity Framework should we set a relationship by using the POCO.Id or just the POCO?

不羁的心 提交于 2019-12-07 13:33:41
问题 I have a situation in a service method where assigning a POCO as a child object of another POCO does not work as expected. I am using Entity Framework 4. public void ChangeOrderCurrency(Currency currency) { order.CurrencyId = currency.Id; order.Currency = currency; // other stuff related to exchange rates etc } Which is more correct to use to set the relationship? order.CurrencyId = currency.Id or order.Currency = currency ? In this current code which passes all unit tests, occasionally the