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...
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...
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
...
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?
...
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,...
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...
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...
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...
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.
...
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 ...
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...
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...
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 ...
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 = ...
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...
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 ...
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...
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...
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...
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...