session « Map « JPA Q&A





1. Adding listener to hibernate session    stackoverflow.com

I recently came across a situation where I have to do some actions when object is updated through Hibernate session, but hibernate session does not have any methods where I can ...

2. Hibernate removes child objects after session.update(parent)    stackoverflow.com

I have a very simple parent-/child relationship between objects of type "Folder", which looks like this:

  • A folder can have 0-1 parent folders.
  • A folder can have 0-n child folders (subfolders).
So, basically, a simplified ...

3. Hibernate Session.evict() with pesistent childs    coderanch.com

At first: Hi @all, because i'm new here. Now my question: I have some objects in a hibernate-session. This objects can be manipulated by several threads (never competitively). Somtimes i have to change objects whithout saving directly. But if a other thread saves an other object the session will be flushed and all objects are saved. I know, i can evict ...

4. Maintaining create/delete/update actions on child records in Hibernate across different sessions    coderanch.com

Hello Hibernate Gurus, I have a parent/child relationship mapped in hibernate just like it is explained in hibernate reference chapter 24 http://docs.jboss.org/hibernate/stable/core/reference/en/html/example-weblog.html My problem is I have a form where I display a blog with all of its items. The user can update/delete and create new items in the form all in one action (HTTP POST) So for example, lets say ...

5. One to one mapping issue with primary key in a new session    forum.hibernate.org

Hi, I have a one-to-one mapping like below: User.hbm.xml user Below is the code used for saving user object User user = new User(); user.setUserId("testuser2"); user.setPassword("testpassword"); user.setUserType("S"); UserDetails userDetails ...

6. Session.setReadOnly and ManyToMany mapping    forum.hibernate.org

Dear Forum, I have an issue where I want have an object, User, with ManyToMany relationship, Addresses. Now, I grab the user with something like this: User object = (User)session.load(User.class, id); I then set the session to read only for that object: session.setReadOnly(object, true); Then I use reflection to setAddresses(new ArrayList()); After the transaction commit, I suddenly see this pop up ...

7. Not able to create session for many to one mapping    forum.hibernate.org

Hi All I have two simple data objects, an object ( Subscriber ) has a reference to another object ( Test ) . It is a many to one relationship i.e many Subscribers can belong to One Test class. With this, I have the following Hibernate Mapping definition.

8. Can't initialise Hibernate session- Mapping exception !!    forum.hibernate.org

Hello All, I have a class with composite primary key. The mapping file for this class is shown below. class--> MwpCatUserAssoc primary key class -> MwpCatUserAssocPk -------------------------------------------------------------------------------

9. reassociating parent-child-grandchildren to a new session    forum.hibernate.org

Hibernate version: 2.1.6 Mapping documents: Code: .... .... ...





10. attach a non-hibernate instantiated mapped class to session    forum.hibernate.org

Hibernate version:2.1.7 (with MySQL 4.0.20) I have a query which needs to return a hibernate entity and a scalar value. I'm using the count() and if() functions from mysql, so I believe I cannot use HQL. Additionally, the entity + scalara combination eliminates using createSQLQuery(). I can, however, retrieve all the properties for the entity instance in addition to the scalar ...

11. session.map();    forum.hibernate.org

Hi, Is there any possibility to map() instead of list? What I need to have in the resulting Map is the Object with its primary key and the object itself for tables having primary key, not a composite primary key. I used to do it in JDBC easily but when I started using Hibernate I always have to iterate the list ...

12. Session.flush() causes child collection to be emptied    forum.hibernate.org

I have a Parent-Child relationship. Contact is the parent, ContactEndPoint is the child. I have a method that creates a Contact, adds the ContactEndPoint to it. Everything looks good, Contact.endpoints contains only the new end point and ContactEndPoint.contact references the correct Contact. I then flush the session and when I check the Contact.endpoints attribute it is empty. Debugging the code reveals ...

13. parent INSERT, child UPDATE ???? on session.save    forum.hibernate.org

Author Message RichMorrison Post subject: parent INSERT, child UPDATE ???? on session.save Posted: Wed Aug 09, 2006 1:46 pm Newbie Joined: Mon Jul 24, 2006 8:55 pm Posts: 6 This is a simple example of a one-to-many parent/child relationship. The parent is an Order and the children are OrderItems. When I run a test to save an Order and ...

14. ability to create child sessions    forum.hibernate.org

Guys, I want to add an ability to create child sessions to Hibernate Session interface. It is because I am having some difficulties using Hibernate in Java Server Faces application using the "session per user request" pattern. I have already made all changes and tested it in my project. What do you think?

15. Problems with unset session when using Map    forum.hibernate.org

Newbie Joined: Mon Jan 15, 2007 1:18 pm Posts: 8 Hi I have a problem mapping a Map in Hibernate 3.3.1GA. In my scenario I have a table A, lets say it contains customer information, including a country code for their country. Then I have a table B, which contains the descriptions for those country codes in several languages, so it ...