Save « Collection « JPA Q&A





1. Hibernate not saving collection of values    stackoverflow.com

Okay, I've used Hibernate in several projects now but I did not learn its intricacies before using it. I started with looking at codes that used JPA Annotations and integrated with ...

2. collection save trying to do an update for non-existent rows    forum.hibernate.org

Author Message dougbryant Post subject: collection save trying to do an update for non-existent rows Posted: Tue Sep 30, 2003 12:16 pm Newbie Joined: Thu Sep 25, 2003 11:04 am Posts: 6 Location: Charleston, SC I have an object (Rule) that has a set of objects (RuleCondition). When I create a new Rule, set properties, add a RuleCondition and ...

3. Changing a collection "off-session" and saving.    forum.hibernate.org

Hi, I'm using Hibernate 2.1.1, Windows 2000, Jdk 1.3 and DB2 7.2. I am trying to do the following: I have a Case object with a set of Involved objects (persons involved in the case). From a web application, I create, changes and retrieves Cases. All saving and retrival happens i a stateless session bean, so the session used when saving ...

4. .:: Saving collections???    forum.hibernate.org

Hi all!!! I'm having some trouble while trying to save collections. Here is my mapping document: Code:

5. Not saving collections    forum.hibernate.org

I have an interesting problem from a design point of view using the hibernate object model. We employ a client-server system where the server is Java and the client is C#. The client can make requests that the server run arbitrary HQL queries and return the result. The client has an object model that mimics the hibernate model so the user ...

6. Saving and updating collections.    forum.hibernate.org

Beginner Joined: Tue Jan 27, 2004 8:25 am Posts: 45 Hi all! I've been some days reading the book I bought, and reading the online documentation, but I'm having some trouble regarding collections. I really need some help to understand this, because I'm getting really frustrated. I'm going to write an example of what I'm pretending to do. Hibernate version: 2.1x ...

7. Update of collection instead of save.    forum.hibernate.org

8. Can Hibernate persist a Collection of Objects in save-Metho?    forum.hibernate.org

Hallo, I so far wasn't able to find a method to persist a Collection of Objects. I only managed to persist one single instance of an object like: session.save(MyObjectInstance); But I have an Array of these objects. When trying to persist an ArrayList of "MyOBjectInstance"Objects I get the following exception: net.sf.hibernate.MappingException: No persister for: java.util.ArrayList Isn't here a default persister for ...

9. how to save collection of value types    forum.hibernate.org

my class VRCInfoRecord has lot of attributes and a collection of strings. All the attributes should be saved in the table LOGMIS, the strings from the collection in LOGINFTX. But it will not work. Hibernate generates just one SQL to insert into LOGMIS but not for LOGINFTX. And there is no exception thrown. The primary key from the first table should ...





10. Saving all collection of objects with one command?    forum.hibernate.org

It's not very hard to implement such a mechanism. It's even listed in reference manual. Here is my implementation Code: protected void saveAll(List data) { Session session = null; try { ...

11. Save failing on object that is reffed by two collections    forum.hibernate.org

Senior Joined: Tue Aug 03, 2004 2:11 pm Posts: 142 Location: Somerset Hi I have a problem which I guess is due to a mapping error on my part. I am modelling a simple generic database. I have a Table, which has a collection of Columns, and a collection of Records. Records have a collection of ColumnValues. A ColumnValue is associated ...

12. Hibernate collection saving issue    forum.hibernate.org

Hi, The issue is as follows. I have a list of contacts associated with a supplier class. In database, it is mirrored by the contact table having supplier_id as foreign key. The add supplier works fine. But, when I try to update the supplier in a way that the list of contacts contains One contact to be be edited (it has ...

13. Collection item not saved    forum.hibernate.org

In the chapter 16 of hibernate reference documentation, it sayed: [quote] 19.5.2. Lists, maps, idbags and sets are the most efficient collections to update From the discussion above, it should be clear that indexed collections and (usually) sets allow the most efficient operation in terms of adding, removing and updating elements. There is, arguably, one more advantage that indexed collections have ...

14. Saving a collection    forum.hibernate.org

Beginner Joined: Fri Feb 24, 2006 12:52 pm Posts: 30 An update SQL is generated for the collection element by Hibernate but an insert was never generated for this table. See below. Hibernate version: 2.18 Mapping documents: ... ...

15. Saving a collection    forum.hibernate.org

Beginner Joined: Fri Feb 24, 2006 12:52 pm Posts: 30 An update SQL is generated for the collection element by Hibernate but an insert was never generated for this table. See below. Hibernate version: 2.18 Mapping documents: ... ...

16. Many-to-Many Collection Saving    forum.hibernate.org

Okay. Just like everyone here, I am a newbie.... I have a fairly simple problem and I hope someone can take a quick look at it and help me out. All that I am trying to do is to associate a SET of items to a User. I'm doing this via an Association Table though because the relationship is many-to-many. What ...





17. A Collection of records not saved properly.    forum.hibernate.org

private Set answers = new HashSet(); ... /** * @hibernate.set table="ctx_answers" cascade="save-update" lazy="false" * @hibernate.collection-key column="ctx_id" * @hibernate.collection-many-to-many class="com.jimpanel.model.survey.QuestionAnswer" column="id" */ public Set getAnswers() { return this.answers; } ...

18. How to save a collection of integers?    forum.hibernate.org

Hello, I have not been able to find an example that saves a collection of intergers. I have an object that contains a java.util.Set I'm able to save/ retrive this object and its properties (name, date, count) However, when I have not been able to create the correct mapping to have hibernate save this object when adding the new java.util.Set property ...

19. saving and updating collection with self reference    forum.hibernate.org

Hi all I've got two classes: self -referencing ClassB and ClassA which works as a wrapper. Code: ClassA{ public void ClassA(String nr){ this.nr=nr } private String nr; ... private Set pr; ... } ClassB{ private String ID; private String nr; private String parentID; private Set pr ; ... } db structure (MySql5) as follows: Code: CREATE TABLE A ( ...

20. Collection of values are not saved    forum.hibernate.org

Hi! I am currently following the tutorial in the documentation and trying out saving a collection of values. The problem I have is that my application is saving collection of entities(Set courses) but not the collection of values(Set contactDetails). Here is my persistent class.. Code: public class Student { private Long id; private ...

21. Error when saving an indexed collection    forum.hibernate.org

Newbie Joined: Fri Aug 14, 2009 8:06 am Posts: 19 Hi, I am experiencing trouble with persisting a List in a class that has children that are instances of the same class. Everything works fine until I commit everything. Then, when calling the getIndex() method, it returns -1, leading to an ArrayIndexOutOfBounds exception. I debugged the code and when committing, for ...

22. work around for saving collections in stateless session??    forum.hibernate.org

Hi all, I want to use stateless session to insert an object Quote, having a map collection, in databse. I know that collections are ignored in stateless sessions but can there be any work around for this??? As i don't really want to use JDBC for just this one when I am using hibernate through out my application. Following is my ...