entity-relationship

Difference between owned one to many relationship and owned one to many bidirectional relationship(Google App Engine Java Api)

what is the difference between owned one to many relationship and owned one to many bidirectional relationship i read the article below but i don't understand it. Article ...

Core Data Relationships in pre-populated SQLite database

Hi All, I'm new to Core Data. Currently I have following tables on hand: tbl_teahcer tbl_student tbl_course tbl_student_course_map ----------- ----------- ---------- ---------------------- teacher_id student_id course_id student_id name name name course_id ...

ASP.NET Membership and Roles separation relationship

Hi, I have an ASP.NET project where I want to keep the membership (SQL Provider) in a separate database and the Roles/Profiles will be per application. Question What is the KEY that relates between the Membership database and the Roles/Profile database? Is it the UserID or UserName? I opened up the tables in separate expolrer and noti...

Modeling a database (ERD) that has quirky behavior

One of the databases that I'm working on has some quirky behavior that I want to account for in the entity-relationship diagram. One of the behaviors is that there is a 'booking' table and a 'invoice' table. When a 'booking' is invoiced, then the record is inserted into the 'invoice' table and then deleted from the 'booking' table. Ho...

How to query JDO persistent objects in unowned relationship model?

Hello, I'm trying to migrate my app from PHP and RDBMS (MySQL) to Google App Engine and have a hard time figuring out data model and relationships in JDO. In my current app I use a lot of JOIN queries like: SELECT users.name, comments.comment FROM users, comments WHERE users.user_id = comments.user_id AND users.email = '[email protected]...

Strange JPA one-to-many behavior when trying to set the "many" on the "one" entity

I've mapped two entities using JPA (specifically Hibernate). Those entities have a one-to-many relationship (I've simplified for presentation): @Entity public class A { @ManyToOne public B getB() { return b; } } @Entity public Class B { @OneToMany(mappedBy="b") public Set<A> getAs() { return as; } } Now, I'm trying ...

Database Design - How do I setup an FK relationship to 1 of 2 tables??

What is the best way to maintain a unique ID field across multiple database tables? My database contains both businesses and people, and both entities need to have a unique ID field associated with it. In addition, there are other tables (for example Addresses) which can reference either a business or a person using their ID as a foreig...

[doctrine 1.x] Many to many relation on the same table

Hi! I'm trying to setup a m2m relation between 'Gabarits'. One gabarit can have many Gabarits ( called Options ) One gabarit can come from many Gabarits ( called OptionsFrom ) Here is my schema.yml: Gabarit: actAs: [Attachable] columns: libelle: { type: string, size: 255 } description: { type: clob } relations: O...

Is there automatic entity relationship diagram generator based on simple ascii syntax?

I am looking for a tool which would generate entity relationship diagram based on simple ascii syntax. Syntax could be something like: thing1 <-> thing2 thing3 <->> thing4 thing5 <<-> thing2 thing1 <<->> thing5 Where: <-> is one to one <->> is one to many <<->> is many to many Or anything similar. There should be this kind of tool...

JPA: Persistence a One-To-Many Relationship

I am using Java EE 6. Just want to throw it out there first Here is the relationship. A customer can have multiple facility Here is Customer Class @Entity public class Customer { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Long id; private String name; @OneToMany(cascade=CascadeType.ALL) @Jo...

entity framework 4, code-only, relationships

Hi, I can't figure out how to solve the following problem. What i need it a relationship from one base class to another, so that every derived class has a relationship with the same table, called 'Item' in my example. Since this is just an example it doesn't reflect my program. In the real program the relationship with class Item is in...

Unable to add foreign keys manually in Entity Framework 4

So I have a sql server 2008 database with 9 tables in them, they don't have any set relationships but is still used as if they have it, this however makes it so that I cant import the relationships when importing the models from the database. Now, when trying to add an association between two tables work but when I want to point tb1.Id ...

Add relationship between entity and property of another entity in coredata

Hi all, I have an entity with an attribute of type "string". I actually want it to be an array. So I created an another entity "array" and I want to add a many-one relationship between string and the array. So my question is: Is it possible to add a relationship between an entity and an attribute of another entity? Thanx in advance. ...

ER-to-Relational Mapping: multi-valued primary key

When mapping an ER diagram to a relational schema, my textbook says that in step.. whatever.. a new relation S should be created for multivalued attributes. But if the multivalued attribute is the primary key of R... that leaves the R with no primary key and S with no primary key? ...

unidirectional one-to-many and many-to-may in django

I'm new to django. I have 2 simple objects, lets call them - File and FileGroup: - A FileGroup can hold a list of files, sorted according to an 'order' field. - Each file can be associated with multiple groups. so basically, the db tables would be: 1) File 2) File_Group 3) File_Group_Mapping table that has a column named "order" in add...

Problem modelling address generalization

Hello, I’m a bit concerned about how to model this rather simple scenario the best way in UML and ERM. When designed it has to be implemented in C# (Entity Framework 4) and SQL Server 2008. The case is that I have a person, who has a postal address. Now this address can be two types, either a postal box, or a house identifier (house nu...

Methods of a "belongs to" and "has many" relationships

Let's say that I have two tables in my database: users countries I have two defined relationships on each user belongsTo a country and each country hasMany users.. (CakePHP model relationships) And I want to crate the model findUsersFromCountry($countryID) in wich class/model this method will be? It must be inside the User model or t...

What is the relationship between these two tables in RoR?

I am developing an application like the stackoverflow, which questions or articles have at less one tag. And one tags must have one or more articles. So, I am doing this in migration in RoR. I am consider which relationship is suitable for both table. In article table, should use a "has_many", and in the tag table, should use "has_many...

JPA OneToMany problems after update

I have 2 Classes, Parent and Child, with a @OneToMany relationship. Every parent has 0 or more children. @OneToMany(fetch=FetchType.LAZY, cascade={CascadeType.REMOVE}) The Parent class has also other fields like the name. I'm in a Container env, so my UI is made of JSP. When I want to change the Parent object I have to pass it to a...

Database design - ERD. Modeling Question

Hello Hopefully someone may be able to quickly advise the best way for me to model my ERD (I'm using IDEF1X & ERWin not Chen Notation) although it doesn't really matter. Basically I have Three Entities Organisation Person Trustee Business rules state that a Trustee can be either a person or organisation. My question is, would i...