relationship

Entity relationship not reading correctly from database

I have an entity relationship setup in my mvc2 application such that each user has one role and each role can have many users. Like so: Roles Users -------- --------- RoleID-- UserID \ Name --> RoleID So a pretty basic many to one relationship enforced in the database and reflected in my entity relati...

SQL: what kind of relation (1:1, 1:m, m:m,...) there is between this two tables?

Hi, what kind of relation (1:1, 1:m, m:m, whatever) there is between this two tables? CREATE TABLE IF NOT EXISTS `my_product` ( `id` int(11) NOT NULL auto_increment, `price` float default NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS `my_product_i18n` ( `id` int...

Add number of records in belongs_to relationship in Rail app?

Hi Everyone? I have a Rails simple application that has two main models. A person model and a gift model. Gifts belong to people, and people have many gifts. I am currently (in the people index view) listing all people in the database with the following code: <% for person in @people %> <li><%= link_to h(person.name), person %></li> <...

How to model the use of one interface as parameter to a method of another interface in UML?

I am using Visual Paradigm for UML to model our class hierarchy. I often have the case where one of our interfaces has a method requires an implementation of another of our interfaces as parameter to a method. Example (C++, interface = abstract class): class IFoo { public: virtual void bla() = 0; }; class IBar { public: virtual...