Questions tagged [persistent-set]

9 questions
4
votes
1 answer

Get IDs out of Uninitialized Persistent Collection

I have a situation that I have not found an answer to when looking through the Hibernate API documentation or on SO. We have a disconnected setup, and we send entities and collections back across the wire. We are looking at a way to use a localized…
aperkins
  • 12,914
  • 4
  • 29
  • 34
2
votes
2 answers

how to sort persistentSet of grails objects?

I have two domain models: class Resource{ String name static mapping = { sort name:"asc" } } class ResourceGroup{ String groupName static hasMany = [resources: Resource] } controller: def resGroups =…
grailsInvas0r
  • 655
  • 2
  • 10
  • 25
1
vote
1 answer

New entity in a set is not persisted

JPA + Hibernate I'm using this code to create a new AvatarAttributeOwnership (AAO) and assign it to a Player. However, the new AAO is not persisted to the database. // get player player = em.find(Player.class,…
Bart van Heukelom
  • 43,244
  • 59
  • 186
  • 301
1
vote
1 answer

Save order of set in hibernate

I have two collections, which by default are set to PersistentSet by hibernate. The issue is that under the hood hibernate casts them to HashSet, but I want them to be set to LinkedHashSet, as I want to preserve the order in which the elements are…
1
vote
0 answers

Hibernate - no updates on PersistentSet

I am using JPA 2.0 standard and hibernate as the persistence provider. While working with ElementCollections I am curious to know why aren't org.hibernate.collection.PersistentSet updatable? The method isRowUpdatePossible() in PersistentSet returns…
Andy Dufresne
  • 6,022
  • 7
  • 63
  • 113
1
vote
2 answers

What should be done to get the Persistent Set filtered using a query condition

I'm having two DAO classes FeeGroup and FeeHeading like this class FeeGroup { private int id; private String name; private Set feeHeadings; private booelan isActive; //getters & setters } class FeeHeading { …
Arun Sudhakaran
  • 2,167
  • 4
  • 27
  • 52
0
votes
1 answer

Change Hibernate's PersistentSet to HashSet

I have a program that compares objects from 2 databases. I have objects from 2 different databases and I have to compare them. The problem is that hibernate returns a PersistentSet and this causes the program to fail as it only supports Java…
ds2799
  • 59
  • 6
0
votes
0 answers

Converting Hibernate's PersistentSet into CopyOnWriteArraySet

I am using CopyOnWriteArraySet in the following class because I simply like its thread-safe iterator. public class MyClass{ Set _children = new CopyOnWriteArraySet(); public void setChildren(Set children){ _children = children; } public Set…
Timo Ernst
  • 15,243
  • 23
  • 104
  • 165
0
votes
1 answer

Hibernate PersistenceSet and Lombok EqualsAndHashCode issue

I have an entity, let's say an item which uses a Lombok annotation @EqualsAndHashCode(callSuper = true) which autogenerates equals() and hashCode() methods. The entities are put inside a HashSet collection. The problem is that when I am getting the…
PrzemyslawP
  • 190
  • 1
  • 13