element « Collection « JPA Q&A





1. Hibernate lazy collections: What about the collection elements - are they lazy too?    coderanch.com

If you have lazy set, then Hibernate will do a hit to the database to get the data when you hit the Collection. However, you can determine how many times it will hit the database. If you set your fetching strategy to subselect, then it will get the data for the collection in one query. If you have no fetching strategy, ...

2. Hibernate 3.5.1 - element-collection support?    forum.hibernate.org

I am using Hibernate 3.5.1 with maven to create a JPA application utilizing JPA 2.0 and Spring. I am not using Spring's JpaDaoSupport or those classes, I am just configuring an EntityManager that gets injected into my class. When I try to define an element-collection element, which appears to be supported by JPA documentation as well as the schema for the ...

3. Is an element of one collection (not) in another collection?    forum.hibernate.org

select distinct u from SystemUser u join u.userGroups g where 4 in elements(g.permissions) and not exists ( select org from Organisation org where org in elements(u.organisations) and org not in ( select d.downloadingOrganisations from Document d where d.id = ? ...

4. Restricting collection elements    forum.hibernate.org

Hibernate version: 2.1 Name and version of the database you are using: mysql 4.0.2 This is more of an abstract question. It appears not much documentation talks about returning and object and only a subset of items in a collection that the object contains. Using the wonderful box and balls analogy, if I have a box full of different colored balls, ...

5. passing a collection to "elements"    forum.hibernate.org

Thanks for the response. It looks like I'm closer but I still get an error. Now, I get the following stack trace. Is it okay that the collection I pass in contains Objects, or does it need to contain only the ids? Hibernate: select foo0_.foo_id as bar_1_, foo0_.title as title, foo0_.bar_id as bar_id from foo foo0_, bar bar1_ where (foo0_.bar_id in(?)) ...

6. No nullability check for collection elements in 2.1.7c?    forum.hibernate.org

Newbie Joined: Thu Jan 20, 2005 8:21 am Posts: 2 Hi! When a property of an element in a list is set to not-null and you try to insert a null, then you will get a SQL exception from the JDBC driver. The nullability is not checked before trying to persist the value. This will also cause the parent to be ...

7. How I can write an xml file when all element is a collection    forum.hibernate.org

Here is a table sample: Id Observation Status 1 Look nice True 2 Good False 3 Could be better True Normally we would considered each row as a transaction and my xml file will look like the one post under the mapping topic and hibernate will do the insert by doing a begin saved commit close transaction. Perfect ...

8. Removing an element from a Collection    forum.hibernate.org

Hi All, I have classes called Role and User as below. When I call user.removeRole(role); the role is removed from the Collection roles in user. But the rows in the db are not updated, thus when I load user, it will still have the role that I have removed from its roles before. public class Role ... { ... Collection users ...

9. Returned collection has first element only on all elements    forum.hibernate.org

Author Message nikkfurie Post subject: Returned collection has first element only on all elements Posted: Mon Sep 04, 2006 11:55 pm Newbie Joined: Mon Sep 04, 2006 11:41 pm Posts: 3 Hello. Whenever I query for a collection, the collection returned would be sized correctly but all elements would all have the value of the first element. In my ...





10. Removal of an element of an 1.N collection    forum.hibernate.org

11. Collection fetches just one single element, but not all    forum.hibernate.org

Hi Hibernate users, since a few days I am puzzling about a problem with a one-to-many collection mapping. The collection does just fetch one single element and not all matching entries. A 'student' has many 'exams'. There are 2 tables STUDENT and EXAM. They are connected with the primary key of a student named 'matrinumber'. I have written a student mapping ...

12. Filtering collection based on a compoite element    forum.hibernate.org

13. unnecessary update for read-only collection of elements    forum.hibernate.org

USER.JAVA: @CollectionOfElements @JoinTable( name="user_roles", joinColumns = @JoinColumn(name="user_id", nullable=false, insertable=false, updatable=false) ) @Column(name="role_id", nullable=false, insertable=false, updatable=false) private Set ...

14. Filter collection elements    forum.hibernate.org

Hibernate version: Hibernate 3.2.6ga Name and version of the database you are using: MySQL Hi, I have the following relationships: Code: 1) Client 1-M Entity (a Client has many Entities, an Entity belongs to a Client, bi-directional) 2) Entity 1-1 User ...

15. Modification of an element of a collection    forum.hibernate.org

I'm building a web app with Stripes/Spring/Hibernate. Basic CRUD-type app. On one page, there's a list of volumes loaded with code from the class VolumesActionBean, and the user can click on one to edit it, which will then open an edit page where the individual volume is again requested by code in VolumeTypeConverter (it's a Stripes idiom). On save, the volume ...