relationship

Many to many lookups in Django

This is probably insultingly simple and worthy of a Nelson Muntz laugh, but I'm having a real braindead moment tryng to make many to many connections across various model relationships. I have the following models (simplified for your enjoyment!): class Document(models.Model): title = models.CharField(max_length=200) author = m...

core data inverse relation

Hi, Can anyone explains with an example for inverse relationship in apple core data ? Thanks In Advance, Raghu ...

In a Use Case Description Document, how do we describe the include relationship with another use case.

In a Use case diagram, we can show the include relationship, but if we have to express the same in the description document, how is that to be done? ...

Relationships in a UML class diagram

I have an application that models a tree, with classes Tree, Node and Edge (I need the Edge class!), and I'm not sure how to represent the relationships in the class diagram for this. I've read other posts about this, but am still in doubt. The Tree object have a pointer to a Node (its root), which I believe defines an one-way associati...

Entity Relation notation in text

Is there a standard (non-graphical) notation for Entity Relationships? right now I'm using my own janky notation: User >> Photo , (1-many) User > Profile , (1-1 hasOne) Profile < User , (1-1 belongsTo) Photo << User , (many-1 belongsTo) Photo <> Tag , (many-many) ...

ms access can't edit field because I must delete relationships but there are no relationships to delete

I have built a database on multiple tables. One of these tables has a field (Initials) that was originally defined to have 50 characters. After building the entire thing I realize I would have liked that field to be limited to 3 characters. I tried to change this, but it tells me that I have to delete one or more relationships. So, I...

Can DataSet handle self-referential relationship?

Hi, I have the following tables: Data ID ... Relationships ParentID //points to Data:ID ChildID //points to Data:ID too If I bring both the DATA and RELATIONSHIPS table into a dataset, is there a way to add the relationships into the model in a way that would add value? e.g. to enforce the constraints for example? If so I ...

Cascade a value in a table

Lets say I have two tables, 'a' and 'b'. The relationship of 'a' to 'b' is one to many. Lets both tables have the field status. This field has the values 'active' and 'inactive'. If I set the field status to 'inactive', does MySQL have a way to cascade this down to all tables tied to the row I changed the status value for? Or would ...

cakephp habtm relationship (saving data)

Question related to HABTM has been posted in some good numbers on stackoverflow but I am still looking for a solution to my problem. I am creating an application that allows for creation of topics based on a particular subcategory. While adding a topic the user is asked for tags (on the same form). Now when the user has finished adding ...

MySQL: How to study/analysis a MySQL DB tables relationships?

I'm given a MySQL DB that contain 108 tables. Is there a way or tool (software) to be able to see how these tables are connected (hopefully in a visual way) so I would be able to understand the usage of each table and how everything is working together. I'm accessing them through something called "MySQL Tools" -> "MySQL Administrator" w...

Reload association/related collection in NHibernate

If I have Order entity with a list of OrderDetails I can easily eager load the detail along with the order by using NHibernateUtil.Initialize(Order.Details). So obviously the NHibernate have all the information to generate the sql statement. But how do I query the database for just the Details (similar to CreateSourceQuery in Entity Fram...

OLAP: Many-to-many relationship between products and parent-child hierarchy of categories

Hello. I need a help with creating OLAP cube which allows to analyse many-to-many relationship between products and parent-child hierarchy of categories. I have next relational structure: table "Products": "ProductID", "Name" table "Categories": "CategoryID", "Name", "ParentID" (where "ParentID" has FK reference to "CategoryID") table...

Problem with one-to-many relationship with Single Table Inheritance (Rails)

I have problem with STI and relationship in ActiveRecord. I think I missed something in the class methods, but I don't know for sure. Below is my models: class User < ActiveRecord::Base has_many :advertisements end class Advertisement < ActiveRecord::Base belongs_to :user end class FreeAdvertisement < Advertisement end class Paid...

Linq to ADO.NET parent/child query help

Hello I want to use Linq to ADO.NET to fetch all rows that match the criteria below from a DataTable. Select all rows where "parentId" equals "id" of a row where "parentId" equals null. Order by "Name". Can someone tell me how to accomplish this (preferably using both Query Syntax and Method Syntax), and possibly point me to where I...

How to map and test a "Many to Many Relationship" in NHibernate using Fluent NHibernate

Hi! When I test my many to many classes an error occurs: System.ApplicationException: Actual count does not equal expected count. Entities: public interface IEntity { int Id { get; set; } } public abstract class Entity : IEntity { public virtual int Id { get; set; } public virtual bo...

Core Data (iPhone)- Limiting the fetch results across a relationship

I have recently been looking at Core Data for the iPhone and I have one query which I have not been able to find an answer to in the literature. Lets imagine that I have a User model object with a to-many relationship with a Purchase object. A User may have thousands of purchases. All of the information I have seen thus far seems to su...

Asp.net MVC-How to add order-orderDetails objects using EntityFramework?

I have an application that uses one-to-many relationshipped objects like oreder-orderDetails, vith EntityFramework. I want to use a view, that make it possible to add a new order with some orderDetails objects. I can create a strongly typed view, that returns an order object wich has a List orderDetails property, but can't populate the...

Associating a model twice, CakePHP

I have the following scheme: My site is a trivia game, so every Question "hasMany" Answers, but a Question also "hasOne" correct Answer that is also represented by the Answer model. I have yet to test this, but my programmer's instinct tells me that the retrieved array will be kind of redundant and it will not separate the correct Answer...

Relationship with Enumerated Type in Java

I'm trying to create a many-to-many relationship between two types of which one is an Enumerated type. Lets say the first model is User and the second model is Role. A user can have many roles and a role can belong to many users. I'd like to be able to write simple code like: if (user.getRoles().contains(Role.ADMIN)) { //do something...

Cakephp retrieving HABTM which Conditions

I'm using cakephp and would like to display all Submissions which are part of Category 'X' I have 4 tables with a HABTM relationship. Users -> (haveMany) -> Submissions <-> (hasAndBelongsToMany) <-> Categories but I would like to do so using the $this->paginate() and for each submission I would like to display the user who posted the s...