parent-child

Nhibernate will not delete child from collection

First the mapping... <set name="Comments" table="cm_events_venue_comment" inverse="true" lazy="true" generic="true" cascade="all-delete-orphan" batch-size="10" order-by="dateCreated ASC"> <cache usage="read-write" /> <key column="venueId" /> <one-to-many class="VenueComment" /> </set> A passing test.. ...

C# - How to deal with 2 "TopMost" Forms?

I have a parent form that is set to be TopMost and then I have another form that opens when a button is clicked. This child form is also set to be TopMost. The first issue I had was that when I opened the child form, the application would basically freeze because you couldn't access anything. I decided that instead of using ShowDialog...

ASP.NET MVC Create view for object with first child object

I have a 'Person' object that has a 'FirstName' and 'LastName' property. The 'Person' also has a 1-n relation with a 'Phone' object. The 'Phone' object has a 'Number' property. So a person can have multiple phone numbers. On the 'PersonController' I have a 'Create' action that loads a strongly-typed view to show a form where I can creat...

QT: Using QPainter on child widgets

I'm having a QT/C++ problem with a simple QWidget program that draws an ellipse inside a child QWidget. The program is composed of: (1) A parent QWidget (2) A child QWidget (used as the drawing surface for an ellipse) (3) A draw QPushButton Here is part of the code (QPushButton Slot and Signal code omitted for simplicity) void Draw::...

One-to-Many Unidirectional Parent-Child ID Cascade Save

When trying to save an ID from my parent class into a child class, I keep getting the error "ERROR - Field 'parent_id' doesn't have a default value" I have tried all types of mappings. I am using annotations. Any help on this would be appreciated Parent: @Id @Column(name="id") @GeneratedValue(strategy=GenerationTyp...

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...

Help with C program(gcc) in Linux

Hi... I have a project for my college but unfortunately, I struggle in programming, apart from simple C programs. Anyway, the way I see it, I think the code I need should be around 20-30 lines, so if somebody can provide me some help I'll be really grateful. Here is the project: A parent process will produce 10 random integer numbers (...

AS3 - Child moves parent using startDrag

I have a MovieClip instance which can be moved around the stage using startDrag() and stopDrag(). The instance also has some child MovieClips using addChild(). The parent moves the children when dragging, which is fine. The children have there own startDrag() and stopDrag() which should apply only to the child object, however it also mov...

XSD Parent Child Relationships

I have an XSD that I created. A Transaction Header can one or more Transaction-Items. This XSD will only allow ONE Transaction Header and multiple Transaction-Items in an XML file. I am looking for MULTIPLE Transaction Headers with it's related multiple Transaction-Items. What is missing in the XSD to allow me to do this? Thanks. ...

Example using OpenXML with Parent Child Relationship and Associated Lookup Tables

I have an XML document that is loaded into a column of a table of the XML data type. Is there any good examples showing how to insert using a store procedure and OpenXML into a parent tables with primary key and also into a child table with it's associated foreign key? Both the Parent and Child have relationships to lookup tables. The ...

Querying Parent-child Relationships Efficiently

Assuming you have the following database table: create table Names ( Id INT IDENTITY NOT NULL, Name NVARCHAR(100) not null, ParentNameId INT null, primary key (Id) ) create index IX_Name on Names (Name) alter table Names add constraint FK_NameNames foreign key (ParentNameId) references Names This allows the ...

MS Access. ADO recordset for subform. Child relationship set up programatically. Won't automatically fill in field.

I have a form/subform for inputting data into an ado table. The main form's recordset is a local table of Widgets and information about the widgets (WidgetID, WidgetName, size, color, location, etc). I am inputting test data (multiple tests per widget, all with unique dates) through the subform which is connected to an ADO recordset to...

XML and Inserting into Parent Child tables with Related Lookup Tables

The FuelPathwayCode and PhysicalPathwayCode go into Parent table and transaction-item elements goes into the Child table. Parent table has a primary key and the child table has the related foreign key. The Parent table has FuelNameID and PhysicalPathwayID columns that are related to two lookup tables: FuelName and PhysicalPathway. Th...

Making relations before save

Hi. I´m using subsonic 3. I´m need pass a parent object with his childs to a custom method before they are persisted , like this: Public Function ValidateParent(parent as Parent) as Boolean For Each child in parent.Childs ValidateChild(child) Next Return true End Function I'm trying to set the Parent.c...

Require a method in parent class to be called in PHP

As the title states, I'm trying to make a method in a parent class required. Although, I suppose it could be any class. For instance: class Parent { funtion foo () { // do stuff } } class Child extends Parent { function bar () { // do stuff after foo() has ran ...

TSQL Cascade delete for child records?

I have a parent/child table (simple tree) table structure (ID, ParentID), where I want to delete (and get the ID of) all children for a given parent ID - similar to this post http://stackoverflow.com/questions/1433808/sql-server-cascade-delete-and-parent-child-table . During the loop, where I've got the current ID, I will also be perfor...

wordpressL How to array the child categories without any html tags?

Hello, I am using a category called 'blogs'. Under that category I have many authors. Each author gets a category for himself. In the 'blogs' template I want to display nicely a for each category and the ecxerpt from the latest post. Unfortunately, when I am trying to use wp_list_categories to query the child of that 'blogs' cat, I ...

How to model parent to child pair in MySQL (SQL)

I have a data model that includes element types Stage, Actor, and Form. Logically, Stages can be assigned pairs of ( Form <---> Actor ) which can be duplicated many times (i.e. same person and same form added to the same stage at a later date/time). Right now I am modeling this with these tables: Stage Form Actor Form_Actor ______...

HTML + Passing Param b/w Parent & Child

Hi All, It might be a simple, but the funny thing is i've tried it for almost 2-3hrs and haven't been able to solve it :(. I have a parent window, which has a text box, and it has a value. I do a window.open and open a client and try to read the value of the parent, but unable to get the value. Any help!! I've tried window.parent....

What is a good db schema and method to query a "Facebook Wall" feature

I'm writing a simple "Facebook Wall" type feature where a user can post on another person's wall and people can simply reply to that Wall post, or post a new wall post. Users cannot reply to a reply, you may only reply to the original wall post (just like facebook) My original mySQL db schema that I had thought of goes like this: pos...