parent-child

one-to-many entity referencing itself in hibernate

This seems to work, but is this the proper way for an entity to have a child set of the same entities? <hibernate-mapping> <class name="com.example.Person" table="Person"> <id name="id" column="Id" type="int"><generator class="native"/></id> <many-to-one name="childOf" class="com.example.Person" column="Child_of_Id"/...

Ruby on Rails: Building a child with default values when its parent is created.

I have a parent and child model relationship. In the child's migration.rb, the child model's columns each have default values (except the parent_id column). When I make a new parent object, how can I make it so that a child object is created and saved into its table with the data from the default values along with the parent_id? I'm th...

A parent class needs to know his child classes

Probem: A parent abstract class must be aware of all his existing child classes. The parent class must also be able to list all the class names of his child classes through a method. Context: In my situation, the parent class is used to represent any input data type for a web form (such as email, text, boolean, integer, image, and so on...

Error while deleting all child controls from the parent control

I have the next aspx page. <%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="newsEditor.aspx.cs" Inherits="ExpertSiteV2.newsEditor" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %> <%@ Register Assembly="ExpertSiteV2" Na...

AddOwnedForm - add WPF Window?

I'm working with an existing WinForms form. I'm trying to interface a new WPF Window with it (to replace an old form). The old code called mainForm.AddOwnedForm(newForm);. I know that that makes the new form somewhat of a child of the main form -- it's hidden when the main form is, etc. Is there a way for me to link a WPF window to t...

Trying to acquire the parent's class of an element using JQuery

So I have acquired the element I want, but I want to check the elements parent class value to verify it is a certain value before doing my logic and I can't quite figure it out. $(document).ready(function() { $('#childElement input').click(function() { var option = $(this).parent('span').class; alert(option.class);...

Actionscript Child within parent within parent

I am trying to make a calculator where a user can select from a list of items. If a user clicks say "ITEM1", it should add the item to a "CONTAINER_MC". The problem i have is all my data is set inside an array containing names and prices like the code below. var menuNames:Array = [ "Item1", "Item2", "Item3", "Item4", "item5", "i...

Dynamic amount of '.parent'

I have 2 object. In different depths of MovieClip. I would like to know if object A parent is same with object B parent. I wanted to dynamically add '.parent' to object A/B till it both reaches the same level (having the same parent object). How can I do that? My idea was to have something like objectA = objectA + ".parent" and make ...

How to model data entities with multiple parents?

How would I model a relationship between multiple entities where one entity could be part of two separate, unrelated, hierarchies and each entity could be related to 1 or more other entities in a non-hierarchical fashion? I would like to do this in only 2 or 3 tables in the database. I currently have it modeled into two tables: Entit...

wpf mvvm - how to send message only to parent?

Hey. I'm building my first app using MVVM and I stuck. Using the messenger to communicate other ViewModels about some changes was working ok until I tried to build an observablecollection of objects. I have a class (myClass) that contains a list (innerList). Elements of innerLists should send message to it's parent (to communicate that...

1 to 1 Object Relations in EF4 Code First

I have a parent object book, and a property of that object is publisher. Everytime I ad a book, it is adding a new publisher, even if the publisher already exists. Can someone tell me how to add the book and instead of adding the publisher again, just reference an existing one? The code i am using is below... Thanks in advance! publ...

Entity Framework - Inserting records in child table when parent record already exists

Good afternoon- I am developing a Silverlight application using LINQ to Entity Framework for the data access layer. My n-tier database model includes about 30 or so tables, with a number of multi-leveled parent-child relationships throughout. Recently began writing my data services and unit tests and have discovered a problem with the...

ASP.NET web app w/parent/child windows-parent times out, doesn't recognize use in child window

I've got a Jquery function that I wrote which blacks out the screen after a certain amount of inactivity, creates a pop-up that allows the user to click a button to stay logged in, and logs them out (closing the application window) if they do not respond in time. We don't technically use master pages, but we do have a parent page in whi...

Scrolling items in sprite

I have a sprite containing a menu of items created from an array of names and prices. When you click on the names of these items it adds the item to a calculator that has quantity, total etc (similar to a shopping cart but without a checkout). I have the entire thing working, the problem is i need the list to be scrollable for the menu a...

Passing data from childView do parentView!

Hi, I am having trouble passing data from a childView to the parentView inside a navigationController when the user click on the back button. I tried using the viewWillDisappear and it is not being called. Any ideias? ...

C#: How to add a row to a child table with a DataSet backing?

On the back end I am using XML files, xsd schemas a DataSet(dsThingPrograms) and DataTables. I have a parent ->child table relationship defined through the DataSet designer as such: things[RFID(pkey), name] programs[ID(pkey/autogen), name, path, thing_RFID(FK references things->RFID)] In my code I have: dsThingPrograms.things.Addthin...

Reporting child window's events to parent window to reset timer value of user timeout code

I've got a Jquery function that I wrote which blacks out the screen after a certain amount of inactivity, creates a pop-up that allows the user to click a button to stay logged in, and logs them out (closing the application window) if they do not respond in time. The environment is ASP.NET (VB). We don't technically use master pages, b...

How to guarantee signal delivery from multiple children

As part of a Linux benchmark application, I have a parent process that forks multiple children that will each perform a task in parallel. I'm using signals to coordinate between them since I'm looking for as accurate of timing as possible. Each child will prepare for the test, then enter a 'barrier' controlled by the parent via signals...

Jquery timeout code not re-running after first time user extends session

I wrote a Jquery function that blacks out the screen after a certain amount of inactivity, creates a pop-up that allows the user to click a button to stay logged in, and logs them out (closing the application window) if they do not respond in time. The environment is ASP.NET (VB). We don't technically use master pages, but we do have a ...

Integrating Jquery timeout code into a classic ASP form in an ASP.NET application

I wrote a Jquery function that blacks out the screen after a certain amount of inactivity, creates a pop-up that allows the user to click a button to stay logged in, and logs them out (closing the application window) if they do not respond in time. The environment is ASP.NET (VB). We don't technically use master pages, but we do have a ...