entity-relationship

a layman's term for identifying relationship

There are couples of questions around asking for difference / explanation on identifying and non-identifying relationship in relationship database. My question is, can you think of a simpler term for these jargons? I understand that technical terms have to be specific and unambiguous though. But having an 'alternative name' might help ...

What kind of queries a website like stackoverflow use?

Hi, I am learning mysql join queries. To pratice, I decided to make tables for a website like stackoverflow. I made three tables basically. Question_Thread thread_id title username datetime Question_Reply reply_id thread_id text Question_Text_Comment comment_id reply_id comment How do I q...

Database design for custom form builder (and storage of results)

I'm trying to implement a custom form builder, similar to those provided by Wufoo and Google. While I've created a simple UI to create these custom forms with, my issues lie in the database design. Upon creating the form, a JSON implementation is saved in the database (would like to improve this) and referenced to build the form that a ...

Hibernate many-to-many association with the same entity

Another Hibernate question... :P Using Hibernate's Annotations framework, I have a User entity. Each User can have a collection of friends: a Collection of other Users. However, I have not been able to figure out how to create a Many-to-Many association within the User class consisting of a list of Users (using a user-friends intermedia...

How do I model a selected entity instance from a set of possible instances in Core Data?

I have two Core Data entities, say Account and House. Each account can have a list of houses and a house can only be in one account, so that's a regular one-to-many relationship with an inverse. An account also has a "primary" property that indicates which of the many possible houses is primary or is nil if there are none. The identity ...

Data Modeling for EAV

How are others using relational modeling tools to map a logical model or one in third normal form to a database that uses EAV? ...

Does a free MySQL Relationship Diagram Generator Exist

Are there any free tools available for generating ERDs from an existing MySQL database? I've been given the requirement to generate such documentation for a legacy database and would prefer to not have to do it by hand. ...

iPhone UITableView populated by checked Table Cells. How?

I came upon this blog post the other day and literally have no idea how to implement it, logically. Any ideas? I was thinking it involves core data, with 'power' being another entity in a to-many relationship, besides that, I'm lost. ...

Entity Framework - Change Relationship Multiplicity

I have a table [User] and another table [Salesperson] in my database. [Salesperson] defines a unique UserID which maps to [User].UserID with a foreign key. When I generate the model with Entity Framework I get a 1-to-Many relationship between [User]-[Salesperson], meaning that each User has a "Collection of Salesperson", but what I want ...

JPA Entity Foreign Keys mapped to a Primary Key

Is it possible for a Primary Key of an nested Entity to be used as the Primary Key of the Nest Entity? For Example: If I had a Entity 'Staff' who has a primary key 'EID' and has the nested Entity 'Job'. The Entity 'Job' has a primary key 'JID', and a Discriminator type 'DTYPE' so that sub classes of Job may be stored in the DTYPE alo...

Delete a relationship?

What is the opposite of: Dim ad As New Address Person.AddressReference.Attach(ad) I mean how do I delete the Person.Address? (both with deleting and without - meaning only delete the relation)? ...

Undelete an entity marked as EntityState.Delete?

Hello, instead of talking let me talk with code: Dim Contact = Context.Contacts.Include("Phones") Dim phone = Contact.Phones(0) Contact.Remove(phone) How do I refresh the context now, canceling last relation deletion? I tried: Context.Refresh(RefreshMode.StoreWins, phone) 'Doesn't recover the relation Context.Refresh(RefreshMode.Sto...

How do I Relate these 4 Tables

Trying to setup a simple Thread/Poll table mapping. Here is what I have: Threads table ThreadID (Primary Key/Identity Column) Polls table PollID (Primary Key, FK for ThreadID for one-to-one relation) Question PollOptions table PollOptionID (Identity/Primary Key) Text PollID PollVotes table PollVoteID (Primary Key/Identity...

what's the best way to search a social network by prioritizing a users relationships first?

I have a social network set up and via an api I want to search the entries. The database of the social network is mysql. I want the search to return results in the following format: Results that match the query AND are friends of the user performing the search should be prioritized over results that simply match the query. So can this...

which tools for drawing entity relationship diagram online and share with colleagues?

Hi all, Is there any website that I can use a demo version to draw an entity relationship diagram and share it with my colleagues? Thank you! ...

Map relationship with Entity Framework

Maybe im just an idiot, but I am having serious issues mapping relationships with the new entity framework. When using LinqToSql, you would just right click the table, add association, select the two tables, and selected the property from each table the association was based on. End of story, it worked perfectly. Using the entity fram...

Simple relational problem

Hello I'm using entity framework with 3.5 sp1, and I've come across a strange problem. I have a 1 to many relationship and I cant seem to add a value for it. I have a table "Bookings" and FK in table "Users" (nullable) and FK in table "BookingObjects" so: Users 0..1 <-> * Bookings * <-> 1 BookingObjects Table: Users Entity: User S...

Eager Loading on tracked items?

I have an element bound to an entity (Contact) that exposes some navigation properties. I want, that on some action (i.e. a "Load children" button), the Contact should load for all its children and grand children like I can do with an ObjectQuery.Include before the execution; example (pseudo): DirectCast(element.DataContext, Contact).S...

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 associate as the parent of the entry being edited. I've got the bindings all set, but when it r...

Should I use an index column in a many to many "link" table?

I have two tables, products and categories which have a many to many relationship, so I'm adding a products_categories table which will contain category_id and product_id. Should I add another (autoincrementing) index column or use the two existing ones as primary key? ...