cascade

NHibernate, one-to-one mapping, cascade insert

I have a one-to-one relationship between a Company class and a CompanySettings class. When I create a new Company object, (a CompanySettings object is created in Company's constructor for its Settings property), and then SaveOrUpdate(session, companyObject) I expect the INSERT to cascade from the Company to the CompanySettings. Howeve...

Jquery.cascade plugin how to match text instead of value?

I am using plugin from here. Thanks for it. I use it for multiple dropdowns. The thing is I want it to filter source list based on text, however plugin filters only by value. Believe it is set in this line: .filter(function() { return opt.match.call(this, opt.getParentValue(parent)); }) opt.match.call - calls match method on dropdown...

hibernate cascade question

I have a hibernate bean called Property which has a type and a value. If type is a certain class (EntityValue) then value is a link to BaseEntity. BaseEntity has a @OneToMany @CascadeType.ALL List properties. In order to safely delete a BaseEntity I will need to make sure it's not part of an EntityValue in any other BaseEntityS. Even...

Need a working example of a cascading drop down list written in vb.net

I Need a working example of a cascading drop down list box written in vb.net for my ASP.Net MVC application. I tried converting three examples written in C# but can't seem to figure it out and I have given up. The examples I have tried to convert are found here and here. This is my first .net application so I'm a newbie. The biggest ...

Multiple FKs with ON DELETE CASCADE to the same table (MSSQL2008)

I'm running into the problem described by KB321843 and this question. Both only talk about MS SQL Server 2005 (or older), while I'm running 2008. I'd really had hope that this is fixed in recent versions, but it doesn't seem like it is. Could someone confirm this (or, better tell me how I could get it to work)? ...

Cascade deletes to indirectly related objects with NHibernate

Further to my other question given the following classes and fluent map, is there any way to automatically cascade delete a DriversLicense when the related Person is deleted? Note, I do not want the Person class to have any knowledge of the DriversLicense class, but I also don't want orphaned data if a Person gets deleted. public class ...

Cascading in (N)Hibernate, which rules do I need?

Sorry if this is a dupe, couldn't find it but didnt really know what to search for, anyway... I have three classes, Parent, Child and Other Parent has many Child where child has a Parent_Id column Other holds a reference to a Child through a Child_Id column When I delete a Parent, I also want to delete all the associated Child object...

Delete rows from two tables in one query

I have two tables: orders and orders_items. Both sharing the field orderID. I want to delete all rows from both tables where orderID=500, but I need to do this in only one query. Is this possible? ...

Nhibernate save update delete relations

Hi, I have a product that has 1 or more product relations. Entities: Product and ProductRelation So product has a property List(Of ProductRelation) Now I have a checkboxlist where I can select a number of products that I want to assign to this product. When I add a new collection of ProductRelations with the new products, It should ...

nhibernate cascade - problem with detached entities

I am going nuts here trying to resolve a cascading update/delete issue :-) I have a Parent Entity with a collection Child Entities. If I modify the list of Child entities in a detached Parent object, adding, deleting etc - I am not seeing the updates cascaded correctly to the Child collection. Mapping Files: <hibernate-mapping xmlns...

Print cascading table

Hi! I'm trying to load data from database and display it in table like here: http://img196.imageshack.us/img196/1857/cijene.jpg In database i have 2 tables: cities (id, name) prices (id, city1_id, city2_id, price) For example, the printed table for 4 cities would look like this: <table> <tr> <td>city1</td> <td> </td> <td> </td> ...

How can I make a cascade deletion in a one_to_many relatonship in Rails ActiveRecord?

I have a model in rails with one_to_many relationship. When I delete the father, I'd like to delete all childrens. How should I do it? I want to delete all orders and its items when I delete a user My models are: class User < ActiveRecord::Base has_many :orders, :foreign_key => "id_user" end class Order < ActiveRecord::Base has_ma...

How to implement cascading deletion of hierarchical data in MySQL?

Hi, I'm working on a project that has categories / subcategories. The database table for this is unique, with the following structure : CREATE TABLE IF NOT EXISTS `categories` ( `id` int(11) NOT NULL auto_increment, `publish` tinyint(1) NOT NULL default '0', `parent_id` int(11) NOT NULL default '0', `description` text NOT NULL,...

Hibernate: Clean collection's 2nd level cache while cascade delete items

I have a problem Hibernate does not update 2nd level cache for a collection of items which are subject of cascade removal. Details Assume we have an object Parent which has Parent.myChildren collection of Child objects. Now we have also object Humans with Humans.myAllHumans collection and all Parent and Child objects are in that collec...

NHibernate: simple delete orphan scenario not working

I'm trying to have a simple one to many relationship/hierarchy using NHibernate. I would like orphans to be deleted automatically but my current attempts to do so all result in an ObjectDeletedException. I'm wondering if someone can tell me what I'm doing incorrectly. EDIT: I should have specified that I'm loading a root Foo, then remo...

What is the difference between REMOVE and DELETE ?

Is there a difference between : @Cascade(org.hibernate.annotations.CascadeType.REMOVE) and @Cascade(org.hibernate.annotations.CascadeType.DELETE) ? ...

Parent save doesn't cascade to children of same abstract in FNH

I am using AutoMapping in FNH 1.0 (with Tom Cabanski's modified #arch from 9/2009) to persist a parent-child relationship. The parent and child, Managers and Employees, are both of type User. Managers has a collection of DirectReports of IList because a Manager can have another manager as a direct report. I have a test where I instant...

DB down on executing delete query

Hi All, Is there a possibility that a simple delete query can bring down a DB? We executed a delete query (single row deletion) and that query hung. When multiple people tried executing the same delete again, the Oracle DB is down. Multiple tables reference this table and a cascade delete was not used. Should a cascade delete have bee...

NHibernate: How to automatically delete many-to-many associations (cascade)

In my database I've got Users and UserGroups which have a many-to-many relation. The User has a set of UserGroup, the UserGroup domain object does not see the User. <class name="User" table="UserTable"> <set name="UserGroup" cascade="save-update" access="field.pascalcase-underscore" table="User2UserGroup"> <key column="User_...

MySQL InnoDB CASCADE?

Hi, I am starting to experiment with using InnoDB in web applications. I've setup some tables with a foreign key, but they are not behaving as expected. Here are my table CREATE statements: CREATE TABLE sections ( section_id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(section_id), title VARCHAR(30), created_at int(10) NOT NULL, upda...