relationships

Displaying RoR relationship

I have setup a model relationship and all is working well when I use code similar to: @parent.child.each do |item| item.name end But how would I call just a specific child given there id eg. Child ID is 14 Would like a call like: @parent.child[childid].name #>>>>>> CHILD'S NAME ...

Products - data schema

I am designing the tables for the products module. One issue is ingredients. I want to filter products by ingredients. So to do this then I guess each ingredient must be stored in the DB separately and given an ID also? But lets take a supplement. It may have 50 ingredients. So if there are 1 million products to store and each has 50 ing...

When can I use Unidirectional relationships in NHibernate?

I'm trying to port a large graph of .NET entities to use NHibernate, but I'm encountering an issue that most of the relationships are only defined unidirectionally - in most cases, the child class contains a reference to the parent, but the parent does not contain the collection of refs to its children. It would be quite a bit of work t...

Quick CoreData question -- inverse delete rules

Quick simple question. Apple's CoreData docs explain how delete rules work on a department's employees relationship. Delete a department, and various different things can happen to the associated employees. But what about an employee's department relationship? Should I set my delete rule to No Action, since I don't want the deletion ...

Smart Oracle tool to find missing field relationships

Does Oracle have a tool I can use to analyze a database and help determine possible missing field relationships? We have a legacy database with 150+ tables and many relationships are missing. We could go through it by hand but an automated tool might be useful. So find things like missing foreign keys and whatnot. ...

drupal user relationships

hey all, throwing this one out there... hope it's a simple one. using the drupal module user relationships i can see my relationships by going to site.com/relationships i need a page that displays the relationships of a different user. is that available? ...

What are methods of programmatically detecting many-to-many relationships in a RDMBS?

Hello stackoverflow, I'm currently busy making a Python ORM which gets all of its information from a RDBMS via introspection (I would go with XRecord if I was happy with it in other respects) — meaning, the end-user only tells which tables/views to look at, and the ORM does everything else automatically (if it makes you actually write s...

Converting ms access to mysql with relationships

I have tried some tools (such as mysql migration toolkit and bullzip's Access To MySQL utility.) that convert a ms access database to mysql which all successfully create the database, tables and insert the data. What they do not appear to do is recreate the relationships (constaints) from the original ms access database into mysql. Ar...

Calculating relationship density across a 1:n relationship

Hi guys, We have a database of listings that contains 2 million records, each with one or more (of a potential 2500) categories (1:n). Over time, some listings have been added to many irrelevant categories (some listings have as many as 50 categories where we like to keep it below 5.) What I'd love to do is audit each category like so...

Database query with relationships in Android

suppose I have the following tables sqlite> SELECT * FROM Artists; ArtistID|ArtistName 1 |Peter Gabriel 2 |Bruce Hornsby 3 |Lyle Lovett 4 |Beach Boys 5 |Supernatural sqlite> SELECT * FROM CDs; CDID|ArtistID|Title |Date 1 |1 |So |1984 2 |1 |Us |1...

hasMany reduced to hasOne in CakePHP

hi, basically i have following models in CakePHP: User(id, username) Photo(id, user_id, path) i have set up following relation: User hasMany Photo. now, on one screen, i would like to list users, and show random photo next to each user. i tried setting up following relation: User hasOne SamplePhoto (where SamplePhoto is just Photo mo...