cascade

Hibernate: OutOfMemory when deleting with all-delete-orphan cascade option.

I have following mapping for my Category objects: @Entity public class Category extends CrawlableEntity implements Identifiable { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Expose private Long id; @ManyToOne(fetch = FetchType.LAZY) private Category parent; @OneToMany(mappedBy = "parent", casc...

Reverse Cascading XML Configuration: How To?

Question: I am wondering if anyone out there has a good answer as to the best way to Reverse Cascade XML configuration. What does this mean: I have a web application framework which hosts many portals. Each of those portals has a XML configuration file which defines various configuration values. Each of those sites can also have n numb...

NHibernate - How to find if a referenced object can be deleted?

I have an object called "Customer" which will be used in the other tables as foreign keys. The problem is that I want to know if a "Customer" can be deleted (ie, it is not being referenced in any other tables). Is this possible with Nhibernate? Thanks ...

small problem in opencascade.

I am new to open cascade, I already displayed the 3d object and have Handle_AISInteractiveContext object. Again i want to change the color by some external parameter. How to do it? ...

Hibernate, instrumentation and delete cascade order

I have a complex object graph with JPA connected entities. When I delete the parent the deletions cascade correctly to the children. Then I instrument the parent class (as to not load eagerly one-to-one relationships) and upon deletion I get referential integrity violation exceptions. Looking at the queries hibernate issues upon flush,...

Exception deleting child records in NHibernate

I have a simple parent/child tables. Contract is the parent table. Each contract can have multiple units. Here is my C# class definitions (simplified): public class Contract : EntityWithIntID { public virtual string ContractNum { get; set; } public virtual IList<Unit> Units { get; protected set; } public virtual int N...

nhibernate will not cascade delete childs

The scenario is as follows, I have 3 objects (i simplified the names) named Parent, parent's child & child's child parent's child is a set in parent, and child's child is a set in child. mapping is as follows (relevant parts) parent <set name="parentset" table="pc-table" lazy="false" fetch="subselect" cascade="a...

CSS - change position absolute left to right in IE

How i can override this declaration, i can do something like this div.someClass {position:absolute; left:10px; top:20px} i want this ----------------------------- div.myClass div.someClass {position:absolute; RIGHT:10px; top:20px; left:auto;} You can say, that it should work if I set left:auto; but it is not working in IE6, i didn't...

Will MySQL InnoDB ON UPDATE CASCADE constraints update properly during a MySQL REPLACE command?

If I have table B with foreign key references to table A (set to ON UPDATE CASCADE) and I run a LOAD DATA INFILE file.txt REPLACE INTO TABLE A; command, will the references update properly? Please note that I'm not talking about ON DELETE CASCADE; I know a REPLACE command will delete records in table B if I have that set. ...

Is SQL Server DRI (ON DELETE CASCADE) slow?

I've been analyzing a recurring "bug report" (perf issue) in one of our systems related to a particularly slow delete operation. Long story short: It seems that the CASCADE DELETE keys were largely responsible, and I'd like to know (a) if this makes sense, and (b) why it's the case. We have a schema of, let's say, widgets, those being ...

Hibernate annotations cascading doesn't work

Hi all, I've decided to change hbm.xml style to annotations using hibernate. I had in my hbm.xml: <hibernate-mapping package="by.sokol.jpr.data"> <class name="Licence"> <id name="licenceId"> <generator class="native" /> </id> <many-to-one name="user" lazy="false" cascade="save-update" column="usr"/> </class> </hibernate-mappin...

Hibernate cascading

All what Hibernate reverse engineering generates is something like this @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "column_id") public Itinerary getColumnId() { return this.columnId; } I want this scenario: when session flushes, first all constructed childs were saved, then the parent object, accord...

mysql on delete cascade do not work

I'm trying to use ON CASCADE DELETE in mysql db but I can't make it work. Here is my code: CREATE TABLE sometable ( testId CHAR(43), blocked BOOL, PRIMARY KEY(testId) ); CREATE TABLE p ( testId CHAR(43), phrase text, source text, FOREIGN KEY (testId) REFERENCES sometable (testId) on delete cascade ); CREATE TRIGGER sometable_insert ...

1:M relationship in Hibernate and cascading operations

Table SUBCOURSE references COURSE COURSE(id, name) SUBCOURSE(id, course_id, name) So, 1:M. Hibernate generates for Course: @OneToMany(fetch = FetchType.LAZY, mappedBy = "course", cascade = CascadeType.ALL) public Set getSubCourses() { return this.subCourses; } for Subcourse it generates @ManyToOne(fetch = ...

Hibernate - how to set null value so that cascading worked [interesting!]?

I'm talking about a detached object, that later I want to update with saveOrUpdate(). How can we at the same time set null and clear() a referenced collection? A [1:1] B [1:M] C B to C reference can be null, that means NO C's records for B. now I want to be able at the same time set B to null so that all C records were deleted from a...

Populating data in multiple cascading dropdown boxes in Access 2007

Hello all, I've been assigned the task to design a temporary customer tracking system in MS Access 2007 (sheeeesh!). The tables and relationships have all been setup successfully. But I'm running into a minor problem while trying to design the data entry form for one table... Here's a bit of explanation first. The screen contains ...

How do I change a child's parent in NHibernate when cascade is delete-all-orphan?

I have two entities in a bi-directional one-to-many relationship: public class Storage { public IList<Box> Boxes { get; set; } } public class Box { public Storage CurrentStorage { get; set; } } And the mapping: <class name="Storage"> <bag name="Boxes" cascade="all-delete-orphan" inverse="true"> <key column="Stora...

How does NHibernate handle cascade="all-delete-orphan"?

I've been digging around the NHibernate sources a little, trying to understand how NHibernate implements removing child elements from a collection. I think I've already found the answer, but I'd ideally like this to be confirmed by someone familiar with the matter. So far I've found AbstractPersistentCollection (base class for all colle...

Hibernate doesn't generate cascade

Hi. I have a set hibernate.hbm2ddl.auto to create so that Hibernate creates the tables in mysql for me. However, it doesn't seem that hibernate correctly adds Cascade on the references in the table. It does however work when I for instance delete a row, and I have a delete cascade as hibernate annotation. So I guess that means that Hib...

What is the correct way to define application-level cascade for many-to-many relationships, using Doctrine/YAML?

Hi, I have this model definition: #/config/doctrine/schema.yml NewsArticle: options: (...) columns: (...) relations: Images: class: Image local: article_id foreign: image_id refClass: ImageToNewsArticle Image: options: (...) columns: (...) relations: NewsArticles: clas...