Questions tagged [entity-relationship]

An entity-relationship model (ERM) is an abstract and conceptual representation of data, information aspects of a business domain or its process requirements. Ultimately ERM is being implemented in a database.

Entity-relationship modeling is a database modeling method, used to produce a type of conceptual schema or semantic data model of a system, often a relational database, and its requirements in a top-down fashion. Diagrams created by this process are called entity-relationship diagrams, ER diagrams, or ERDs.

The main components of the ER diagrams are the entities and the relationships that exist among them. For example with the original notation, in the relational databases tables are shown as boxes, its attributes as ovals and their relations with other tables with lines.

The three schema approach to software engineering uses three levels of ER models that may be developed:

  • Conceptual data model is the highest ER model, that contain least granular detail but establishes the overall scope of what to be included in the model set.

  • Logical data model contains more detail than the conceptual ER model. Operational and transcational data entities are defined.

  • Physical data model - one or more such models can be developed from each logical ER model. Normally developed to be instantiated as a database, therefore each physical model must contain enough detail to produce a database.

2962 questions
14
votes
1 answer

Foreign key mapping inside Embeddable class

I am using eclipselink for JPA. I have an entity, which has a composite key fabricated out of two fields. Following is my Embeddable primary key class' fields(members). @Embeddable public class LeavePK { @ManyToOne(optional = false) …
Ahamed
  • 39,245
  • 13
  • 40
  • 68
13
votes
3 answers

Core Data Inverse Relationship Not Being Set

I've got two Entities that I'll call A and B. They are configured with To-Many relationships in both directions, so A.myBs and B.myAs are both NSSets. Here is my bizarre problem. When I add a B to my A entity, I do it using the…
p.pad
  • 529
  • 7
  • 11
13
votes
3 answers

Problem in mapping fragments in Entity Framework

I am using Entity Framework and I ran into an odd build error. I am building a forum and I set up a table in the database for "ignores" when people don't like each other they will ignore someone. The table has two columns and together they are the…
CatDadCode
  • 58,507
  • 61
  • 212
  • 318
13
votes
4 answers

Tool for convert SQL code to diagram

can any one say some way to convert SQL code to data diagram like ERD ? for som DBMS like MySQL or general SQL
Sajad Bahmani
  • 17,325
  • 27
  • 86
  • 108
13
votes
3 answers

Parent object is in EntityState.Unchanged, but it still inserted in the Database

I have a simple snowflake schema out of which I generated my Entity Framework model. The problem is that I am trying to map a child entity to an existing parent and/or grandparent entity, but it still inserts it. I followed this: Insert new…
Martin
  • 298
  • 3
  • 10
12
votes
1 answer

Using Entity Framework with historical data

I'm building a windows application in .Net 4.0 to create and organize electronics projects. The main purpose of the application is to record the vendor information for the electronics components (part #, description, price, etc.) and organize…
12
votes
4 answers

Single line with an arrow mark in Entity Relattionship diagram

What do single line with an arrow mark in ER diagram represent?
starthree
  • 141
  • 2
  • 3
  • 5
12
votes
4 answers

ER Diagram - Showing Deliveries to Office and to its Branches

For a small project, I am creating an entity relationship diagram for a simple stock-tracking app. User Story Products are sold by product suppliers. Products are ordered by an office and delivered to them. One or more deliveries may be required…
GoofyBall
  • 401
  • 3
  • 8
  • 25
12
votes
2 answers

Laravel Eloquent nested relations returns data only on the first element

Intro Im havning some trubble getting the data on all the related elements. Im using Laravel as a REST backend service, exposing Json to the front-end javascript application. Data structure Consider I have the following tables: +----------------+…
R. Gulbrandsen
  • 3,648
  • 1
  • 22
  • 35
12
votes
1 answer

Core Data Relationship Fault

Tracking a familial relationship in Core Data (1 parent entity + 2 types of children, one of which is recursive), trying to create a drop-menu in Interface Builder that lists the names of the parent entities so that the user can choose one to…
Kaji
  • 2,220
  • 6
  • 30
  • 45
12
votes
1 answer

How to create EER model from a sqlite db

i'm using sqlitejdbc libraries to create a db using java. Now i need to generate eer model from existing sqlite db stored in a file. In past i used MySqlWorkbench to generate eer from a mysql db, but i don't know how to do that on sqlite db.. can…
Jayyrus
  • 12,961
  • 41
  • 132
  • 214
11
votes
5 answers

How to model a database with many m:n relations on a table

I am currently setting up a database which has a large number of many-to-many relations. Every relationship was modeled via a link table. Example: A person has a number of jobs, jobs are fulfilled by a number of persons. A person has a number of…
11
votes
4 answers

Repository pattern: Implementation and lazy loading of model relationships

I have an application which deals with products and product categories. For each of these I have models defined using POCO. // Represents a product. class Product { public virtual int ID { get; set; } public virtual string Name { get; set; } …
11
votes
4 answers

Using Api Platform, automatically assign user to Object (OneToMany)

Here is my scenario: I have an Article entity. Each Article has an owner (a User). A user can own many articles. The user can post an article over the API. I want to have the user_id column for the article set automatically based on the Bearer token…
Wildcard27
  • 1,437
  • 18
  • 48
11
votes
4 answers

doctrine2: how to convert a one-to-many to a many-to-many without losing data

In my application, I want to convert a one-to-many to a many-to-many without losing the data : from: /** * @ORM\ManyToOne(targetEntity="\AppBundle\Entity\FoodAnalytics\Recipe", inversedBy="medias") * @ORM\JoinColumn(name="recipeId",…
Sébastien
  • 5,263
  • 11
  • 55
  • 116