Home Grails UserType mapping with Gorm 6.1
Reply: 0

Grails UserType mapping with Gorm 6.1

user911 Published in March 20, 2018, 3:21 pm

I'm having a problem with a mapping in Grails 3.3. I've created a custom type "PriceType" which uses two columns, amount and currency. I have a property of this type in a domain class and I get a "Cannot treat multi-column property as a single-column property" when I start up the application.

This is the mapping in the domain class:

class PaymentClientsInformation {
    Price amount

    static constraints = {
        amount nullable: true

    static mapping = {
        amount type: PriceType, {
            column name: 'PRICE_AMOUNT'
            column name: 'PRICE_CURRENCY'

and the sqlTypes of the type:

int[] sqlTypes() {
    [BigDecimalType.INSTANCE.sqlType(), StringType.INSTANCE.sqlType()]

Has anyone faced this problem? (edited)

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.466803 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO