collection « JPA « Spring Q&A





1. Why do associated collections contain null values? (Hibernate, Annotation, Spring)    stackoverflow.com

[Edit: Apparently, this is only an issue for arrays and FoxyBOA's answer might direct to (or even is) the answer.] Hi, my question relates to these software: Hibernate3+Annotation, Spring MVC, MySQL and ...

2. How to bind a Child collection element to a Parent command class through addChild convenience method (Spring MVC)    stackoverflow.com

I have a domain class named Parent as follows

public class Parent {

    public List<Child> childList = new ArrayList<Child>();

    public void setChildList(List<Child> childList) {
   ...

3. Hibernate/Spring: Persisting collections    stackoverflow.com

I've got two objects: User and Permission, where User has a Collection. In my "create" service, I read a bunch of Permissions, put them in a HashSet, add them to the ...

4. JPA/hibernate big collections    stackoverflow.com

In a scenario with two types of entities, Parent and Child: Parent - @OneToMany Collection children; The default is to have lazy loading on the collection of children. This model works great for ...

5. What is the correct way to initialize collection of an entity (POJO) in Spring-Hibernate project?    stackoverflow.com

I have a POJO class, say Foo, which has a Set of other entity instances, say bars. Also there are standart misc classes for such project: service and dao for both Foo ...

6. Spring & Hibernate: load lazy collection    stackoverflow.com

How do you explicitely load a lazy Object/collection? So far I've found the only way to do this is to explicitely ask for a getter/setter of the object while it is still ...

7. How to add/delete elements from a collection on an entity in Hibernate?    stackoverflow.com

Basically, how would I make it so that I can add a new TestEntity to the test set after the person has already been created? Also, how can I add a ...

8. Exception in Hibernate (Don't change the reference to a collection with cascade="all-delete-orphan")    stackoverflow.com

I am getting a weird problem in hibernate. I am using hibernate and spring in my project. Problem is I am having a parent child relation, and when I try to update ...

9. Using collection.clear() on @ManyToMany in Spring->JPA->Hibernate results in a N delete statements    stackoverflow.com

When using c.clear() where c is of type Collection representing a @ManyToMany owning relationship, Spring->JPA->Hibernate produces a single delete statement for every entry in the collection such as: Hibernate: delete from printer_feature ...





10. Hibernate indexd collection when using a Where in the mapping    stackoverflow.com

Looking for some insight. I have a OneToMany mapping like this:

    <list name="addresses" cascade="all-delete-orphan" where"HIDDEN='Y"" >   
    <key column="PERSON_ID" not-null="true" />   
 ...

11. org.hibernate.LazyInitializationException: failed to lazily initialize a collection    forum.springsource.org

org.hibernate.LazyInitializationException: failed to lazily initialize a collection AGAIN - web is full of these, but none covers my problem. How comes? I have several datastructures like Container (Class with a list) ...

12. Collections are not persisted, because Spring sets Hibernate-Flush-Mode to Manual    forum.springsource.org

Collections are not persisted, because Spring sets Hibernate-Flush-Mode to Manual My Spring-3.0.5/Hibernate-3.3.0 webapp does not store collections. When creating a new persitent object with an asscociated collection, the object is persited, ...

13. How to update Collection using HibernateTemplate, without previously retriving it???    forum.springsource.org

How to update Collection using HibernateTemplate, without previously retriving it??? I just cannot figure out how to perform this.... I believe it is 'catch' somewhere, but I simply could find answer ...

14. Hibernate: Unable to get a collection but can get the size    forum.springsource.org

Hibernate: Unable to get a collection but can get the size Hibernate version: 2.1.7b Mapping documents: Code: ...

15. Hibernate architecture problem with lazy collections    forum.springsource.org

Hibernate architecture problem with lazy collections Hi. Let's say I have User object containing Role collections. Mening I have : public class User { ... public Set getRoles() { ... } ...

16. hibernate lazy collection initialization problem    forum.springsource.org

hibernate lazy collection initialization problem Spring version: 1.1.4 Hibernate version: 2.1.8 OS: Windows XP Pro JDK: Java 5 Others: I'm using AndroMDA to generate the persistence layer (that includes everything Spring) ...





17. Spring, JSF, Hibernate & Lazy Collections    forum.springsource.org

Spring, JSF, Hibernate & Lazy Collections I am working on a web application using JSF, SPring and Hibernate. On one of my JSP pages I need to make a reference using ...

18. Don't dereference collection w/ cascade="all-delete-orp    forum.springsource.org

Don't dereference collection w/ cascade="all-delete-orp I'm getting this stack trace: Code: org.springframework.orm.hibernate3.HibernateSystemException: Don't dereference a collection with cascade="all-delete-orphan": od.domain.Category.childCategories; nested exception is org.hibernate.HibernateException: Don't dereference a collection with cascade="all-delete-orphan": od.domain.Category.childCategories org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:630) ...

19. org.hibernate.AssertionFailure: collection was not processed    forum.springsource.org

May 10th, 2005, 01:50 AM #1 vasu View Profile View Forum Posts Private Message Junior Member Join Date Apr 2005 Posts 14 org.hibernate.AssertionFailure: collection was not processed Hibernate v 3.0.1 SpringFramework ...

20. [Hibernate] Failed to lazily initialize a collection    forum.springsource.org

May 13th, 2005, 05:17 AM #1 SimonPM View Profile View Forum Posts Private Message Junior Member Join Date May 2005 Posts 1 [Hibernate] Failed to lazily initialize a collection Hello, I'm ...

21. hibernate filter on collection data member    forum.springsource.org

hibernate filter on collection data member Hi, I am trying to initialize a collection in MyObject. I used filter like this return (List)getHibernateTemplate().execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException ...

22. Index field of Hibernate collections corrupted    forum.springsource.org

Index field of Hibernate collections corrupted We're experiencing a very strange problem in our web application. First, here are the relevant packages we are using: spring-1.1.4 hibernate-2.1.8 ehcache-1.1 We have ...

23. indexed collections and hibernate    forum.springsource.org

indexed collections and hibernate Hello all, Just wondering what others are doing to access indexed collections when there hibernate objects are mapped as sets since indexed access requires an array,list or ...

24. Hibernate - evict collection    forum.springsource.org

Hi I am using Spring 1.2 and Hibernate 3.0.5. I would like to evict a collection in a class, how can I do that with HibernateTemplate or in HibernateCallback? Hibernate's SessionFactoryImpl ...

25. jstl and accessing collections inside hibernate object    forum.springsource.org

jstl and accessing collections inside hibernate object I'm using spring together with hibernate. I just started to switch to jstl from plain jsp. My problem is that I can't figure out ...

26. How to update parent without erasing child collections?    forum.springsource.org

How to update parent without erasing child collections? Greetings, I'm using WebWork as a front-end to Spring/Hibernate along with the OpenSessionInViewFilter. The problem I'm having is that when saving the parent ...

27. Hibernate - Deleting Object From One Collection Causes Exception In Another    forum.springsource.org

Hibernate - Deleting Object From One Collection Causes Exception In Another Got a strange (to me at least) one here. I've got a Hibernate object with two collections - SizeOptionCollection and ...

28. Hibernate : find a collection    forum.springsource.org

Yes, I've searched. To do the stuff, i first wrote... getHibernateTemplate().find("from MyClass"); But i get a NullPointerException when my webapp is deployed in JBoss...i could give you the stack later. It ...

29. Slow insertion of string collection in hibernate?    forum.springsource.org

Slow insertion of string collection in hibernate? I am very new to both hibernate and spring. I am using hibernate3 and spring1.2.6. I have developed a trivial application with hibernate3 and ...

30. Type safe collections with Hibernate    forum.springsource.org

Hi everybody, is it possible, to do execute a named query in hibernate and get a type safe list as a return type (without java 1.5 warnings)? I have read that ...

31. Hibernate lazy collection initialization does not work    forum.springsource.org

Mar 20th, 2006, 11:37 AM #1 len53 View Profile View Forum Posts Private Message Member Join Date Mar 2006 Posts 81 Hibernate lazy collection initialization does not work I have one-to-many ...

32. Hibernate query to return sorted collection    forum.springsource.org

Let's say I have a Person object with an association to a collection of Credit Cards. Is there a way to write a query so that for each Person object returned...the ...

33. Don't dereference a collection with cascade="all-delete-orphan"    forum.springsource.org

Don't dereference a collection with cascade="all-delete-orphan" Hi, I have a very weird problem. I have a method doSomething() in a java application implemented in Spring. When I run the method without ...

34. How to use Lazy Collections using spring jpa?    forum.springsource.org

How to use Lazy Collections using spring jpa? Hello all, I am new to JPA and have written a dao using spring jpa so my dao extends the JpaDoaSupport class. How ...

35. JPA, Spring 2.0, Hibernate 3.2 and Lazy Fetching of collections    forum.springsource.org

JPA, Spring 2.0, Hibernate 3.2 and Lazy Fetching of collections I started this discussion as part of another thread, but I feel it deserves its own. I'm trying to use Hibernate ...

36. Hibernate delete sub collection    forum.springsource.org

Hibernate delete sub collection Hi guys: I have a Firm class: Code: public class Firm implements Serializable{ private Set rates; @OneToMany(mappedBy="firm", fetch = FetchType.EAGER ,cascade=CascadeType.ALL) public Set getRates() { return rates; ...

37. Collection loading behavior between getHibernateTemplate().find(...) and loadAll(...)    forum.springsource.org

Dec 20th, 2006, 04:05 PM #1 fortknox View Profile View Forum Posts Private Message Junior Member Join Date Dec 2006 Posts 3 Collection loading behavior between getHibernateTemplate().find(...) and loadAll(...) I have ...

38. Using Hibernate Dynamic Filtering for Collections with FilterDefinitionFactoryBean    forum.springsource.org

Using Hibernate Dynamic Filtering for Collections with FilterDefinitionFactoryBean Hello, We need to run this by the folks in this forum to see if there is something really obvious that we may ...

39. consult concepts: collection hibernate and eclipse    forum.springsource.org

Hi guys this is not really a problem but i have this doubt for example in this part of some DAO method Code: ...... DetalleIngresoInsumos detalleIngresoInsumos = new DetalleIngresoInsumos(); try{ Articulo ...

40. Hibernate Template question (default collection)    forum.springsource.org

Hey, I am using a hibernate template to get at a collection of entities persisted in the database. I also create a custom collection class that i use to add additional ...

41. lazy collection in top level fetch with Hibernate    forum.springsource.org

lazy collection in top level fetch with Hibernate I have a very large table. I need to iterate through it. I'm confused. I used the hibernate reverse engineering tool from eclipse ...

42. Hibernate polymorphic collection problem    forum.springsource.org

Hibernate polymorphic collection problem I have two classes: @Entity(polymorphism = PolymorphismType.EXPLICIT) @Inheritance(strategy = InheritanceType.JOINED) public class A{} @Entity public class B extends A{} When I load all A's or ...

43. org.hibernate.LazyInitializationException: failed to lazily initialize a collection o    forum.springsource.org

org.hibernate.LazyInitializationException: failed to lazily initialize a collection o I don't whats exactly prob is all about but it is throwing me following exception. From other thread i understood of using getSession().load(UserDto.class, ...

44. Hibernate Search] hibernate.AssertionFailure: collection was not processed by flush()    forum.springsource.org

Hibernate Search] hibernate.AssertionFailure: collection was not processed by flush() org.hibernate.AssertionFailure: collection was not processed by flush() the above exception is occuring when ever iam trying to update a indexed entity in ...

45. Need to update parent without deleting child collection    forum.springsource.org

Need to update parent without deleting child collection Hi all! I'm writing web application using Hibernate 3.2 with Spring 2.5. My problem is that when I update parent object the child ...

46. Hibernate criteria one-to-many searching with collection    forum.springsource.org

Hibernate criteria one-to-many searching with collection I have a typical one-to-many scenario where a user is associated to a set of groups. I would like to display a list of users ...

47. Initialize Hibernate collections using AliasToBeanResultTransformer    forum.springsource.org

Initialize Hibernate collections using AliasToBeanResultTransformer Hi I'm running a HQL query and using an AliasToBeanResultTransformer to create bean instances. Child collections are not initialized by that transformer, I believe this is ...

48. Hibernate Collection    forum.springsource.org

Hi, I am using hibernate for persistance. I found different collection in Hibernate like Bag, Set, List, Array and Map. Will anybody tell me that what is the difference of between ...

49. while using hql how do i initialize a collection.    forum.springsource.org

while using hql how do i initialize a collection. I am getting a org.hibernate.LazyInitializationException: illegal access to loading collection. The common sol seems to be to use lazy = true on ...

50. saving collection of entities with HibernateSupportDao    forum.springsource.org

I want update collection of entities instead of saving it one after the other I want save all of them at once how . Currently I am using the method getHibernateTemplate().saveOrUpdate(o); ...

52. Hibernate does not save a collection after having had some validationerrors    forum.springsource.org

Hibernate does not save a collection after having had some validationerrors Hi! We have a form where the user can upload files, but they can only upload files if the have ...

53. Hibernate JPA & Spring very large collections    forum.springsource.org

Hibernate JPA & Spring very large collections I have a setup where a user uploads a list of messages. The relevant classes/fields are: Code: Job MessageList messageList MessageList // some other ...

54. Getting Hibernate LazyInitializationException with no Collections etc    forum.springsource.org

Getting Hibernate LazyInitializationException with no Collections etc I am having some issues using Spring & Hibernate. I have an object which contains a Date attribute and an appropriate getter (getDate). It ...

55. Getting org.hibernate.HibernateException: Illegal attempt to associate a collection    forum.springsource.org

Getting org.hibernate.HibernateException: Illegal attempt to associate a collection Hi! I have a batch job which essientially moves hibernate entities from one databaes to another and deletes the entitiy from the original ...

56. defining hashsets for hibernate collections    forum.springsource.org

im using HashSet objects for collections in hibernate. is it necessary to specify the type of objects that will be stored in the collection? for example Set types

57. Collections not saved using HibernateTemplate    forum.springsource.org

Collections not saved using HibernateTemplate Hi all, I have a very strange problem while using HibernateTemplate... My situation is the following... I have a many to many relation with the following ...

58. collection mapping in hibernate    forum.springsource.org

collection mapping in hibernate Hello, I have problem with collection mapping in Hibernate. I have two database tables: user(id:number, username:varchar2, pass:varchar2) and userpermission(user_id:number, permission:varchar2). In my application I have entity User ...

59. Collections only returning 1 result using Hibernate. Please help.    forum.springsource.org

May 12th, 2009, 07:09 AM #1 mystic View Profile View Forum Posts Private Message Senior Member Join Date May 2009 Posts 246 Collections only returning 1 result using Hibernate. Please help. ...

60. Hibernate Returning empty collection    forum.springsource.org

May 22nd, 2009, 09:24 AM #1 swapan1 View Profile View Forum Posts Private Message Junior Member Join Date May 2009 Posts 2 Hibernate Returning empty collection Hi, I am new to ...

61. Hibernate - Best Method: Working Lazy-loading Sets Example + Counting Collections    forum.springsource.org

Jul 20th, 2009, 05:05 PM #1 Daxon View Profile View Forum Posts Private Message Member Join Date Dec 2008 Posts 33 Hibernate - Best Method: Working Lazy-loading Sets Example + Counting ...

62. Fetching children entities IDS (rather than whole entities)when fetching collections?    forum.springsource.org

Fetching children entities IDS (rather than whole entities)when fetching collections? Hello all ! Basically my problem is the following : We have some objects for which we use the second level ...

63. is it safe to use LinkedHashSet for collections in entity    forum.springsource.org

I am wondering is there any problem using LinkedHashSet for any collection mapping in an entity , the reason I am asking is all the examples I saw uses HashSet and ...

64. Efficient query for related entity in collection    forum.springsource.org

Efficient query for related entity in collection I'm using JPA and hibernate (Core 3.3.2, entity manager 3.4) with Oracle 10g. Question: What's the best (or a good way) to query for ...

65. JacksonJsonView doesn't work with collections in Hibernate entities    forum.springsource.org

JacksonJsonView doesn't work with collections in Hibernate entities I'm trying out the JacksonJsonView in the (yet to be released) org.springframework.js project. It all worked fine, and it even rendered simple Hibernate ...

66. Converting Hibernate collections using HttpInvokerServiceExporter    forum.springsource.org

Converting Hibernate collections using HttpInvokerServiceExporter I'm using HttpInvokerServiceExporter to allow client applications to access server data that is loaded by Hibernate. Because Hibernate has its own collections classes, I have to ...

67. failed to lazily initialize a collection on cached drop down when editing child    forum.springsource.org

failed to lazily initialize a collection on cached drop down when editing child Ok, So I have two classes, one is a Unit (child) the other is a UnitType (parent). I ...

68. org.hibernate.LazyInitializationException: failed to lazily initialize a collection o    forum.springsource.org

org.hibernate.LazyInitializationException: failed to lazily initialize a collection o I've added the OpenSessionInViewFilter to my webapp to handle lazy fetching, but I keep getting an LazyInitializationException. The error log states that the ...

69. Hibernate Mapping Set collection within Map    forum.springsource.org

70. Oracle returning bulk collection into w Spring JDBC    forum.springsource.org

Any ideas how to implement Oracle's returning bulk collection into with Spring's jdbcTemplate or other? For example, delete XYZ_MESSAGE where MSG_ID in (select MSG_ID from MESSAGE_VW) returning MSG_ID, FOO bulk collection ...

71. Hibernate Lazy Loading : could not initialize collection    forum.springsource.org

Jul 27th, 2010, 11:36 AM #1 superSpring17 View Profile View Forum Posts Private Message Junior Member Join Date Jul 2010 Posts 1 Hibernate Lazy Loading : could not initialize collection Hi ...

72. unit testing Entity collections    forum.springsource.org

unit testing Entity collections I have an application where I use local transaction management to control all persist/merge operations on my various entities. For query methods I don't use any transactions ...

73. Persist an entity and its initialized collections...    forum.springsource.org

Persist an entity and its initialized collections... Hi there I'm developing a web app, I have to persist a Project entity with its two initialized collections, internals and externals (professionals), this ...

75. Dynamic Filtering of Collections (with Spring)    forum.hibernate.org