grails « Map « JPA Q&A

1. Order by children property in Grails

Is it possible to create a criteria that lists all objects sorted by sope property of their children? For example:

class Post {
    User owner

Post.withCriteria {
    order('owner.registerDate', ...

2. How to force Grails to use proper column type in MySQL for Map field

I have a problem in Grails 1.1.2 + MySQL. My domain class Something contains field

Map<String, Map<Integer, Integer>> priceMap
When I run the app, Grails creates table 'something' and sub-table 'something_price_map'. 'something_price_map' contains ...

3. Does overloading Grails static 'mapping' property to bolt on database objects violate DRY?

Does Grails static 'mapping' property in Domain classes violate DRY? Let's take a look at the canonical domain class:

class Book {
     Long id

4. hibernate + grails error and question

I just changed all of the classes in my grails project to a new package. This involved adding the package syntax, and creating the folder structure accordingly. Now I am getting ...

5. Possible to pass a Map object to HQL

Is it possible to pass a whole map object to a HQL query without iterating over it? I would if I have to but thought there might be a cleaner way. For ...

6. How to save inherited objects in hibernate

I have three classes

Rule Contract Trip and class Contract extends Rule.and class Trip has contract object . TripInstance.contract = contractObj
i ...

7. Grails ORM question - dont get it working

Im sorry for asking, Im really really new to Grails and Im trying to develope my first application. I researched a lot and I found some answers to my problems, but ...

8. Hibernate mapping using annotations problem

I am working with a Java project using Hibernate annotations. I have a problem when mapping some domain classes with Inheritance.SINGLE_TABLE. Here are my detail problem:
I have 3 tables: TRACKING, GROUP ...

9. Grails & JPA column name mapping

I have a production Grails application that was working fine in Grails 1.3.3. After something went awry in the 1.3.3 repos, we can no longer build on that version. That particular ...

10. Hibernate case sensitive mapping with Grails

Hello, I'm a new developer in Grails. I'm thus using hibernate to store my data in the database. My problem is that I want to use a PostGres SQL legacy database and I need to keep my model with the correct case. I have the following Grails configuration : dataSource { pooled = true driverClassName = "org.postgresql.Driver" dialect = org.hibernate.dialect.PostgreSQLDialect //dialect ...