parent-child

Why isn't my NHibernate bag collection setting the 'parent id' of the children dynamically?

I have a new object with a collection of new objects within it on some property as an IList. I see through sql profiler two insert queries being executed.. one for the parent, which has the new guid id, and one for the child, however, the foreign-key on the child that references the parent, is an empty guid. Here is my mapping on the par...

Parent-Child object relationship events.

Howdy, Is it an acceptable strategy for a child object in a typical parent-child OO relationship to raise an event that the parent catches then passes a value back to the child through the EventArgs? I have a situation where the child needs data from the parent, but the parent does not have that data at the time the child is instantiate...

How to dynamically call child class methods in PHP 5?

<?php class foo { //this class is always etended, and has some other methods that do utility work //and are never overrided public function init() { //what do to here to call bar->doSomething or baz->doSomething //depending on what class is actually instantiated? } function doSomething() { //...

Representing parent-child relationships in SharePoint lists

I need to create some functionality in our SharePoint app that populates a list or lists with some simple hierarchical data. Each parent record will represent a "submission" and each child record will be a "submission item." There's a 1-to-n relationship between submissions and submission items. Is this practical to do in SharePoint? ...

Javascript "onMouseOver" triggering for children?

I can't tell if this is a result of the jQuery I'm using, but this is what I'm trying to do: <div class="info" style="display: inline;" onMouseOut="$(this).children('div').hide('normal');" onMouseOver="$(this).children('div').show('normal');" > <img src="images/target.png"> <div class="tooltiptwo" id="tooltip" style="font...

Inheritance, Parent-Child and Overriding...

Just came across this quote in a book on OOP that I'm reading, A child is only allowed to augment functionality and add functionality. A child is never allowed to remove functionality. If you do find that a child need to remove functionality, this is an indication that the child should appear before the parent in the ...

Create pointer to parent object in deserialization process in C#

I have a classes like: [Serializable] public class child { public Parent parent; } [Serializable] public class Parent { public List<child> children; } When I deserialize Parent, I want each of each children to have a reference to it's parent. Question is, where in the deserialization process can I set the child's "parent" poi...

1 Parent with 2 Child Drop Down

I am trying to create 1 Parent Drop Down, that has 2 dependent child drop down lists using JAVASCRIPT. My html page is at - http://www.larkgrove.com/entryform/entryform.html I am using the Dynamic Options Lists / Dependent Selects: http://www.javascripttoolbox.com/lib/dynamicoptionlist/examples.php If you check out my site, you can se...

NHibernate child to polymorphic parent mapping

Hi, Using NHibernate 1.2.0. I have a parent-child relationship with a polymorphic parent class. The child has a many-to-one "Parent" property referencing the base parent class. In HQL, starting from the child class, I need to access a property of one of the derived parent types. Something like: select parentA.SomeProperty from Chil...

Are child processes created with fork() automatically killed when the parent is killed?

I'm creating child processes with fork() in C/C++. When the parent process ends (or is killed for some reason) I want all child processes to be killed as well. Is that done automatically by the system? Or I have to do it myself? Thanks. Pre-existing similar questions: http://stackoverflow.com/questions/269494/how-can-i-cause-a-chil...

How do you determine when a button is clicked in the child on the parent - ASP.NET

In my child user control I have a gridview with an OnRowCommand eventhandler that is executed when Edit button is click. I want to set the visibility of an ASP.NET placeholder control in the parent to true when the Edit button is clicked in child control. What would be the best way to accomplish this task? Update: After a little bit m...

Is it better to use properties in the child class to access the parent, or make the parent public?

I have 2 classes, a parent and a child. Class Test Private Test_Text Private Sub Class_Initialize() Test_Text = "Hello" End Sub Private Sub Class_Terminate() End Sub Public Property Get Text Text = Test_Text End Property Public Property Let Text(ByVal strIn) Test_Text = strI...

Oracle, deleting many records with child tables

Situation: table TBL has ~10k entries for deletion table TBL has 14 child tables with delete rule "no action" I want to delete 10k entries and referenced entries in child tables Procedure: delete records in child tables disable constraints (if constraints are not disabled deletion in next step takes forever) delete records in TBL t...

Hanging a Child Process

I am trying to test out my system and wish to emulate a condition, where the child process gets hung. For doing this, I am trying to attach the child process to GDB and putting a break on it. But things don't seem to be going as expected. Also, in the same vein, how do I know that a spawned child process is not progressing, but is hung?...

Why does the child process here not print anything?

Assume all the variables have been declared previously... because they have been. The child process does not print anything which makes me think it's not being executed. The parent process runs fine, albeit it doesn't get the shared memory. I apologize for the length of this code... // create 5 child process for(int k=0;k<5;k++){ ...

Parent-child relationship with LINQ2SQL and POCO objects

I just started learning LINQ2SQL and one of the first things I wanted to try is a simple parent-child hierarchy, but I can't seem to find a good way to do it. I saw some examples here on SO and i've googled, but I couldn't apply them directly, so I'll explain exactly what i'm trying to accomplish. Lets use the common example with tags. ...

How can I get a reference to the parent object when deserializing XML in C#?

I can't seem to get this working, here is my (stripped down) code: - [XmlRoot("report")] public class Report { [XmlArray("sections"), XmlArrayItem("section")] public List<Section> Sections; } public class Section { public Report Report; } Am I missing something? ...

What is the best data structure to use for an offspring relationship?

There must be a standard data structure to hold, for instance, dog breeding information, plant genetic crossbreeding, and complex human relationships. One might think it would be an easy tree structure, but the combination of two (or more, for genetic engineering) parents per offspring, multiple different offspring per parent set, multi...

Best practice for Parent / Child UI design in ASP.Net?

Coming from a desktop client background, with no real data-driven web design experience, I am studying ASP.NET UI design to determine the best UI pattern for Parent/Children data. I always tend to experiment with Parent/Child presentation when learning a new UI platform, so that is where I have started here. Thinking I should use ASP.NE...

Sticky situation where accessing parent functions is necessary in Java

I've been working on an economy simulator in Java and ran into a roadblock. I have an Economy class that owns a vector of Traders. Every iteration, the Economy class calls each Trader to update() and decide what trades it would like to place. The update() function returns the desired transactions to be added to the queue in the parent Ec...