In MSSQL 2005 I just struck the infamous error message:
Introducing FOREIGN KEY constraint XXX on table YYY may cause cycles or multiple cascade paths. Specify ON DELETE NO ACTION or ON UPDATE NO ACTION, or modify other FOREIGN KEY constraints.
Now, StackOverflow has several topics about this error message, so I've already got the...
Given the following object model
class Test
{
...
public string Name {get;set;}
public IList<Test2> Collection {get;set;} //mapped with cascade="all"
}
class Test2
{
...
public string Name {get;set;}
}
and code sample
var test = new Test();
test.Collection.Add(new Test2(){Test=test,Name="1"});
//saving new entity with N...
I have two classes A and B. Many B's can have association with a single A, hence a many-to-one relationship from B to A. I've mapped the relationship like:
<class name="A" table="tbl_A">
<property name="propA" column="colA"/>
</class>
<class name="B" table="tbl_B">
<property name="propB" column="colB"/>
<many-to-one name="a" class...
I've been racking my brain trying to come up with a solution to this.
For a database class, I need to implement the following:
Table HUSBANDS: (Name Varchar2(10)) (Wife Varchar2(10))
Table WIVES: (Name Varchar2(10)) (Husband Varchar2(10))
and using Oracle constraints, enfore the following rules:
No two husbands can have the same na...
Hello,
I need to perform an ON DELETE CASCADE on my table named CATEGORY, which has the following columls
CAT_ID (BIGINT)
NAME (VARCHAR)
PARENT_CAT_ID (BIGINT)
PARENT_CAT_ID is a FK on CAT_ID. Obviously, the lovely SQL Server does not let me use ON DELETE CASCADE claiming circular or multiple paths to deletion.
A solution that I see o...
I'm using the jQuery.Cascade plugin in my Asp.Net MVC application. I've got it all working in a manner as follows:
jQuery("#CompareModelList").cascade("#CompareManufacturerList", {
ajax: { url: '/Home/Models' },
template: commonTemplate,
match: function (selectedValue) { return this.Manuf...
I am trying to find a way to use Open Cascade(www.opencascade.org) - 3D Modeling Technology in one of our software which is written in Delphi.
I did manage top find an ActiveX which supports Open Cascade, but on trying it I did not like the visual quality of rendered images. The ActiveX lib can be found here (www.ewcad.com).
I am not ...
What does Cascade in Nhibernate mean?
I see a lot of options in cascading:
Delete
All
AllDeleteOrphan
DeleteOrphan
SaveUpdate
Can you explain these with with examples and their distinctions?
...
My object model
Person
_______
public IList<Role> Roles { get; set; }
public IList<Group> Groups { get; set; }
Group
_____
public IList<Role> Roles { get; set; }
Role
____
public string Role { get; set; }
So pretty much a standard roles based model, a User can exist in zero to many groups which have roles assigned to them, and can e...
Hi,
I am then using Fluent NHibernate and its automapping feature to map the the following simplified POCO classes:
public class Webpage
{
public virtual int Id { get; set; }
public virtual string UrlIdentifier { get; set; }
public virtual WebpageType WebpageType { get; set; }
}
public class WebpageType
{
public vi...
Are there any internet resources that have a definitive guide to all of the cascade settings for NHibernate that will include examples of the class structure, HBM and the implications of actions with each of the cascade settings for all of the relationships with NH.
Also it would be helpful if there were examples for common associations...
I'm building a web site that uses a fair amount of drop shadows and gradients. I can accomplish a lot of this via CSS's box-shadow properties.
Alas, we're still supporting IE, so we need to add background images in those situations.
I could be lazy and just give everyone the background images, but I'm trying to streamline things for t...
I have a Core Data model which has three entities: A, B, and C. A has a one-to-many relationship with B, and B has a many-to-many relationship with C. The delete rule for A -> B is "Cascade", and B -> A is "No Action". The delete rule for B -> C is "No Action", and C -> B is "Deny".
I am having trouble performing a delete on the A entit...
I have Country and State objects. I intend to have unidirectional many to one relationship from State to Country. I don't want to store any references to States in Country I have defined mapping as below. When I delete even one State object, all Countries are deleted!
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hib...
I'm a hibernate newbie and I'm not entirely sure how to get the cascade behavior I'm looking for.
Let's say I have two classes A and B with bi-directional many-to-many mappings to each other. A is the owner side and B is the inverse side (I hope I have the terminology correct).
public class A
{
private Set<B> bSet = new HashSet<B>(...
I'm trying to map a @ManyToMany association using hibernate. But so far I only managed to have cascade on one of the foreign keys.
My source code goes like this:
@Entity
public class Airplane {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private Long id;
@OnDelete(action=OnDeleteAction.CASCADE)
@ManyToMany(m...
Hello,
I try to map a one-to-many relation with cascade "remove" (jpa) and "delete-orphan", because I don't want children to be saved or persist when the parent is saved or persist (security reasons due to client to server (GWT, Gilead))
But this configuration doesn't work. When I try with cascade "all", it runs. Why the delete-orphan ...
model a:
has_many :b, :dependent => :delete_all
model b:
belongs_to :a
belongs_to :c
model c:
has_many :b
When I delete an a, I would also like to have children b's deleted so that they get removed from any c's that may reference them. However, the above isn't working. I'd appreciate any help.
...
The lead developer on a project I'm involved in says it's bad practice to rely on cascades to delete related rows.
I don't see how this is bad, but I would like to know your thoughts on if/why it is.
...
In oracle, I can issue a DROP TABLE ... cascade constraints and it won't complain about FKs, etc.
Is there an equivalent in T-SQL?
...