sort « Map « JPA Q&A





1. How can I sort in (n)hibernate on a property of a child object?    stackoverflow.com

I have an object from my domain model that has a child object. How can I use a criteria query to order based on a property of the child? For example:

class ...

2. Collections - Ordering and Sorting?    stackoverflow.com

In Hibernate, we have several collection classes like bag, list etc.. I have a list of component let's say Bids mapped with Parent entity Item. What I want to do is

  • Persist ...

3. Criteria Query: how to sort on value in Map collection?    stackoverflow.com

I can't seem to find an example of how to do this, so any help will be appreciated. My schema has an object that looks like this:

@Entity
public class User implements Serializable {

 ...

4. Hibernate mapping sort / order-by?    coderanch.com

5. many-to-many mapping with one side sorted by index needed    forum.hibernate.org

Hi everybody, I need a many-to-many mapping with one side sorted by index. Sounds simple, but every example I found either went off on a much too complex tangent or ended unfinished. Basically, I have Parent objects with a list of Children and Child objects with a set of parents. I want to manipulate the list and I want Hibernate to ...

6. help! sorting Map using Session.filter    forum.hibernate.org

7. Collection Set with Sort -> children with same name dropp    forum.hibernate.org

Hi I've come across this problem and I can't quite grasp the logic behind it. Appreciate it if anyone can help elaborate the why. We have a simple parent-child relationship (self-referential table) with additional implementation of name sorting routine. ID = PK PARENT_ID = FK And I have in the db: ID | Name | PK -------------------- CatA | CatA | ...

8. Sort/Order by Child field ----- Help pls    forum.hibernate.org

9. How to put sort comparator in a mapping file...    forum.hibernate.org

eagle79 wrote: Could you post a short version of your myapp.model.Staff class (short meaning cut out most of the vanilla implementing code and let us have a look at the structure)? Ok, here goes: Code: package myApp.model; import java.io.Serializable; import java.util.*; public class Staff implements Serializable, Comparable { public Staff() {} ...





10. Retrieving sorted parent-child criteria    forum.hibernate.org

Hi all, I have a one-to-many relationship, which is normally lazely loaded. For performance reasons, Somewhere I'd like to retrieve the result in a single query, but sorted on a parent field, and then, per parent, sorted on a child field. But somehow, the criteria api always sorts on the child field first, and then returns the parents in the wrong ...

11. sort and limit child collection    forum.hibernate.org

Farzad, Thanks for your reply. I am trying to use the custom loader, but having issues. I am getting "Named SQL query not known" error. When I stepped through the Hibernate source, for some reason it is calling getNamedSQLQuery(), rather than getNamedQuery(). I tried to track down how to trigger it to call getNamedQuery(), but the source path branches way before ...

12. Sorted Collection in many-to-many JPA mapping    forum.hibernate.org

Hi! I have a small problem, have looked around for a while without success, so I thought I would ask for some help. Here the problem: I have a many-to-many mapping between users and groups that I want to define using a JPA ORM. My classes are: Code: public class User implements Comparable { private String name; ...