class « Collection « JPA Q&A





1. Grails Hibernate Session Troubles - failed to lazily initialize a collection    stackoverflow.com

Error:

Error 500: null
Servlet: 
URI: 
Exception Message: failed to lazily initialize a collection of role: Student.lockers, no session or session was closed 
Caused by: Error executing tag <g:render>: Error executing tag <g:link>: ...

2. Play Framework and the use of collections in model classes    stackoverflow.com

I've just started with the Play Framework and I'm running into some problems using a collection in one of my model classes. I am very new to Play and JPA/Hibernate, so ...

3. How to add collections to a data transfer class in Hibernate    stackoverflow.com

I have the following setup where a class contains a collection. When querying instances of this class I like to populate a data transfer class rather than the data class. However, ...

4. collection of base class throws WrongClassException    forum.hibernate.org

Hi, I have annotated a class PackageProfile which contains a set of AbstractPackages, when I tried to load the class, I got the WrongClassException. Here is the class hierachy. PackageProfile extends AbstractProfile, Package extends AbstractPackage. There is ManyToMany relationship between PackageProfile and AbstractPackage. Here is my annotated code: Code: @Entity @Table(name="PF_PROFILES") @Inheritance(strategy=InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = "objecttype") public class AbstractProfile extends BasicModel implements ...

5. Collections with Super class    forum.hibernate.org

Hi: I have an interesting problem. I have a class called Member which is a subclass of Individual. Now, this superclass has setContacts() and getContacts() methods. These are the setter and getter of a list of objects of the type Contact. I have two tables one for Member and one for Contact. The guts of my XML file looks like this: ...

6. PersistenceDelegate for Hibernate collection classes    forum.hibernate.org

Newbie Joined: Tue Nov 16, 2004 1:10 pm Posts: 5 Here is a PersistenceDelegate that converts Hibernate collections classes into java.util collections classes. This allows them to be passed through a java.beans.XMLEncoder. When decoded they become java.util classes. See also HB-931. To use, add to your Encoder the PersistenceDelegates returned by getDelegates(). This has been tested with JDK 1.4.2. Note: XMLEncoder/XMLDecoder ...

7. Hibernate collection Class replacement disable    forum.hibernate.org

I have some classes that have collections in them. I create and populate them which works fine. Then when I save, hibernate replaces the normal ArrayList and HashSet, etc. collections with hibernate internal versions. Is there any way to prevent this replacement? What is the purpose of it if hibernate can already handle persistence of the regular java util collections? I ...

8. Two collections of same class    forum.hibernate.org

First of all, I think you may need to convert your List declarations to Set. I have had issues with Hibernate saying it could not retrieve two bags simultaneously when I had multiple attributes of a class which were of type List as the collection class. Furthermore, a set actually is semantically correct. It would not make sense for a user ...

9. Custom Collection Classes    forum.hibernate.org

Hi, I am looking to accomplish the following Entity A is linked with a one to many with Entity B However, I do not want to define a OneToMany Collection of B in Entity A. Rather, I want to create a OneToOne on Entity A to a custom collection class (CustomA) CustomA would have a oneToMany of Entity B. I have ...





10. Hibernate Collection Classes    forum.hibernate.org

I am working now in a very strange and obviously suboptimal environment. We are serving an application whose front end is AOL Instant Messenger. In AIM-Speak, we are a "bot" and we are served up under Tomcat. In addition to this, our servers are, for some historical reason that remains unfathomable to me, not deployed in a data center, but exposed ...