size « Map « JPA Q&A





1. Specifying field size of Map collection in grails DOM    stackoverflow.com

I have a Grails 1.3.7 domain class that is declared like this:

class Document {
    String url

    Map metadata = new HashMap()

    static ...

2. object.children.size() possible without initializing?    forum.hibernate.org

After reading and experimenting with the 2nd level cache quite extensively, I've gotten to a situation where I want to simply count the number of children of an object, but not initialize those children. In fact, I have the join cached in a collection cache and it would be totally fine with me if I could simply get a size() call ...

3. order by children size    forum.hibernate.org

Hibernate version: 3.2 I'm in situation that I have to list items up ordered by children's count. Let me say parent is 'User' and children is 'Order'. This is basic one-to-many relation. One user can have multiple orders. I've already finished working on mapping file and generation POJO, etc. Then how can I get the list which tells top 10 users ...