entity-relationship

Entity Framework naming conventions for many-to-many link tables

Hi, We are designing a SQL Server database with link tables for many-to-many relations. The question is are there any best practices for naming these kinds of tables for use with the entity framework? Let's say there's a table Customer and Address Then there is a link table between them, what do we call it? CustomerAddress ? Or some...

Is there a declarative language for data definitions?

Reading about WPF and thinking about my application's data store at the same time led me to wonder if there are any languages or tools that allow you to define relational data in a declarative way? A shallow Google search suggests no such thing exists. Yet it seems so obviously useful. The kind of tool I have in mind would declaratively...

Entity Framework ObjectSet detach method functionality

Well, first of all I'll explain the whole situation. I have simple POCO domain model which I'm persisting with EF 4.0. For the first time I used only navigation properties and no FK properties. But later due to some binding purposes I decided to add FK properties to my model (Company_ID in the code below). Here are two classes from that ...

How to configure a NSPopupButton for displaying multiple values in a TableView?

Hi there! I'm using two entities A and B with to-many-to-many relationship. Lets say I got an entity A with attribute aAttrib and a to-many relationship aRelat to another entity B with attribute bAttrib and a to-many relationship bRelat with entity A. Now I am building an interface with two tables one for entity A and another for entit...

Core Data - Relationship to dissimilar entities

Suppose I have the following data model: Entity Person Attribute name String Attribute personType String Attribute dailyRecords Entity CarpenterDailyRecord Attribute numberOfNailsHammered Int Attribute picNameOfFinishedCabinet String Entity WindowWasherDailyRecord Attribute nameOfBuildingWashed String Attribute numberOfWindowsWashed I...

one-to-one relationship using JPA

I have created two table using JPA. i need to give 1-1 relationship between these tables. Can any one tell me how to give relationship between these tables. ...

In this example, would Customer or AccountInfo properly be the entity group parent?

In this example, the Google App Engine documentation makes the Customer the entity group parent of the AccountInfo entity. Wouldn't AccountInfo encapsulate Customer rather than the other way around? Normally I would think of an AccountInfo class as including all of the information about the Customer. import javax.jdo.annotations.IdGener...

JPA - Entity design problem

I am developing a Java Desktop Application and using JPA for persistence. I have a problem mentioned below: I have two entities: Country City Country has the following attribute: CountryName (PK) City has the following attribute: CityName Now as there can be two cities with same name in two different countries, the primaryKe...

Hibernate and parent/child relations

Hi to all, I'm using Hibernate in a Java application, and i feel that something could be done better for the management of parent/child relationships. I've a complex set of entities, that have some kind of relationships between them (one-to-many, many-to-many, one-to-one, both unidirectional and bidirectional). Every time an entity is...

Database relationships using phpmyAdmin (composite keys)

Hi, I am bit confused on making a good relational database. I am using phpmyAdmin to create a database. I have the following four tables. Don't worry about that fact place and price are optional they just are. Person (Mandatory) Item (Mandatory) Place (Optional) Price (Optional) Item is the main table. It will always have person...

Entity framework POCO

What does one loose by creating POCO using T4 templates in entity framework 4.0? Why is the default behavior when using entity framework 4.0 not to create POCO? ...

Entity Relationship Model: Ternary Relationships

Hi, I am trying to understand why this statement in the book is wrong: "given a C entity, there is at most one related A entity and at most one related B entity". Is it that it doesn't apply to a specific kind of relationship?? So, if I have an example of a student who is in attendance to a course with a type of subject. The entities ...

How to merge 2 entity types in 1 gallery, ordered.

Hi all, I'd like to know what the best general approach would be for the following: I have a Showcase and a Showcase has many Image as well as Video. I would like to have those Images and Videos in one gallery, and I would like to be able to order them within that same gallery. Images and Videos (can) belong to many galleries. I'm looki...

[Database] How to model this one-to-one relation?

I have several entities which respresent different types of users who need to be able to log in to a particular system. Additionally, they have different types of information associated with them. For example: a "general user", which has an e-mail address and "admin user", which has a workstation number (note that this a hypothetical ca...

Does Hibernate support one-to-one associations as pkeys?

Hi all, Can anyone tell me whether Hibernate supports associations as the pkey of an entity? I thought that this would be supported but I am having a lot of trouble getting any kind of mapping that represents this to work. In particular, with the straight mapping below: @Entity public class EntityBar { @Id @OneToOne(optional = ...

Entity Relationship Diagram - Relationship Strength?

Hi, I am trying to figure out under what circumstances I should use weak (non-identifying) relationships (where the primary key of the related entity does not contain a primary key component of the parent entity), verses when I should use strong (identifying) relationships (primary key of the related entity contains a primary key compon...

Entity Relationship Diagramming

I'd like to improve my understanding of cardinality constraints in ER diagrams. I have two entities: User Location But, I want the relationship between these two entities to be many-to-many (a user can be in many locations and a location can have many users). To do this I need to introduce an association class UserLocation. Is it ...

iPhone Core data - Not constant path between entities

Hi everyone, I have an entity which has relationships with other entities. Let say we have: user->menu->meal My problem is that some of the users don't have a menu. So when I try to check: user.menu.meal == rice I get an error (path not found...)! Thank you for your help! ...

Doctrine: How to traverse from an entity to another 'linked' entity?

I'm loading 3 different tables using a cross-join in Doctrine_RawSql. This brings me back the following object: User -> User class (doctrine base class) Settings -> DoctrineCollection of Setting User_Settings -> DoctrineCollection of User_Setting The object above is the result of a many-to-many relationship b...

How to design this simple database?

I have 2 tables - one storing user information (id, username, password) and the second one storing information about events (id, name, description, date, username(represents the user who created the event)). I would like to implement 'favourite events' functionality. This would allow the user to store his favourite events and later displ...