question « Cascade « JPA Q&A





1. hibernate cascade question    stackoverflow.com

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

2. A question on JPA Cascading    stackoverflow.com

I have two entities called User and UserProfile in my datamodel. Here is how they are mapped. Code from User Entity:

@OneToOne(cascade=CascadeType.ALL)
@PrimaryKeyJoinColumn
public UserProfile getUserProfile(){
    return this.userProfile;
}

public void setUserProfile(UserProfile userProfile){
  ...

3. Hibernate: cascade question    stackoverflow.com

In hibernate, there are many information about set cascade to "all, delete" and so on, but I want to know the effect of set cascade to "none" now I have a class ...

4. JPA cascading question    stackoverflow.com

I have 2 entities A and B:

  1. As knows nothing about the Bs
  2. Many Bs have a reference to an A
Is it possible to define this relationship so that all the Bs with ...

5. JPA Cascade question    stackoverflow.com

I was working with JPA. And more I work, more I get confused about cascading. Lets consider a use case.

class Category {
   @OneToMany(cascade=CascadeType.ALL)
   List<Application> applicationsnew ArrayList<Application>();
}


class Application ...

6. new to Hibernate - cascading update question    coderanch.com

hi all, i'm just starting to work with hibernate and i have this situation i don't really understand. maybe someone can explain? i have a product object that has a parent which is again a product. hibernate mapping looks something like this:

7. Hibernate cascade question    coderanch.com

Merge when you have a detached object and you want to re-attach it to a Hibernate Session, you need to merge, so that Hibernate can do some work, like checking the managed objects to see if one with that id already exists, and if so check to see if they are the same objects, so that there is only one instance ...

8. cascade="none" question?    forum.hibernate.org

9. One-to-One cascade question    forum.hibernate.org

i have a userbean that has a 1-to-1 mapping with an addressbean and a profilebean. here is the hbm.xml Code: ...





10. cascade question    forum.hibernate.org

I was reading about cascades in section 9.3... I've defined a parent / child relationship between Team and Player: In this test class, only player p1 is saved. This happens because the player identifier is null, and the equals method in PlayerVO class returns "true" when it compares p1 and p2 instances. Then p2 instance isn't added to the collection. My ...

11. Cascading save/update question    forum.hibernate.org

I am trying to determine how cascading works. If I set cascade="all" on a particular Parent/Child one-to-one (modelled as many-one foreign key type ) relationship, then if I pass the Parent to session.save(), then does that pass the child also to session.save()? If that is the case, is it true even if the child has already been saved in a previous ...

12. Question about cascade settings    forum.hibernate.org

Hi there, I wonder myself, if I really understood the cascade stuff right. Here is what I belive it is all about: As an example lets assume we have a category category and children productA and productB. 1. Cascade triggers an update of related elements. It can be specified on parent and/or children side. So a product can specify a cascade ...

13. cascading question    forum.hibernate.org

public class Obj1 { private Long id = null; private Obj2 obj2 = null; // mapped with cascades="true" ... } public class Obj2 { private Long id = null; private Map threes = null; // mapped with cascades="true" ... } public class Obj3 { private Long id ...

14. unidirectional many-to-one with cascade question    forum.hibernate.org

Hibernate version:2.1.6 Name and version of the database you are using:postgresql 7.2 Hi everybody, Suppose I have two classes (A and B) and I am using a many-to-one unidirectional association from B to A (B has a foreign-key to A). How will changes in class A objects be cascaded to associated class B objects? Does cascade="delete" mean that when an Object ...

15. save-update cascade question    forum.hibernate.org

One thing i've always been curious about is why there are no separate cascades fro save and update. I've often thought such a feature very useful. Is this due to some technical concern? Will Hibenrate 3 allow cascading only on inserts and not on updates? If there is no technical reason for it how simple would it be to modify hibernate ...

16. Cascading Question. Might be very basic.    forum.hibernate.org





17. Hibernate: Cascade save-update question    forum.hibernate.org

I have a question about Hibernate saving/updating entire object tree: 1. The presentation layer requests a deep copy of parent object, then it modifies the parent object as well as some of its children objects as per the form data. The session at this point is closed. 2. After modifying the parent/child objects, the presentation layer calls businees and then Data ...

18. A cascading question (probably)    forum.hibernate.org

I have a customer class which contains a Set of addresses. Adding an address to the customer and saving the customer works fine, as does modifying an address. However, removing an address from the customer and saving the customer does NOT delete the customer from the database. The log shows that the address has been removed successfully from the customer object ...

19. A question about many-to-many cascades    forum.hibernate.org

I have a schema like this: A -> B -> B_C <- C Where '->' means 'one to many' and '<-' means 'many to one' (in other words, the arrow is points towards the many side). B_C is an association table between B and C, establishing many to many multiplicity. My classes and mappings for this schema look like this: A ...

21. Question about the efficiency of Cascading    forum.hibernate.org

Dear friends, Since I am new to Hibernate, I am trying to explore the benefits of using it, definitely it is very useful and very state-of-the-art solution. I only have one doubt, which I believe it is not very effective in some cases where the data can be in huge numbers. For example, suppose I have "Event" entity, and there are ...

22. Question on cascades    forum.hibernate.org

I had a question about cascades. I've seen examples where a parent is created, it is given the required information, persisted to the database, and then the children are added. The cascade will nicely save the children out. However, what if the parent is created along with all of its children *before* it is persisted to the database the first time? ...

23. question about cascade with JPA    forum.hibernate.org

On page 419 of the JPA with Hibernate book, there's a pullout that says that only the JPA persist() method is cascaded at flush-time. I'm actually having a problem with cascading updates, does this really mean that if I load an object and just let the end of the transaction do my dirty data writing there won't be any cascading? Seems ...

24. cascading question    forum.hibernate.org

Hibernate version: 3.2 A question about cascading . . . Let's say I have a table "A" which maps to class "A" and a table "B" which maps to class "B" Their relationship is one-to-many, that is A can have many B's. Table and class B contains idA, a foreign key to A. Now let's say I delete a record from ...

25. Hibernate, database, foreign key, cascade question    forum.hibernate.org

I have a general question that I can't seem to find a solid answer to so I will post it here: Hibernate gives us the option to specify 1-1, 1-N, N-1, N-M relationships and also cascading options as well. What about the database level options for cascading after specifying foreign keys and such at the database level? Example: Code: CREATE TABLE ...

26. question: Cascade OnDelete Action    forum.hibernate.org

How can I trigger Hibernate to perform an "alter table" that updates a primary key to have "On Delete" == "Cascade" in MySql ? I would like to achieve it with annotations && not perform the SQL itself. I need that to happen for a OneToMany relationship between 2 tables and so far the code that I have does not do ...

27. hibernate annotations question - use of @Cascade    forum.hibernate.org