Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6475443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:42:19+00:00 2026-05-25T06:42:19+00:00

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

  • 0

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

class Document {
    String url

    Map metadata = new HashMap()

    static constraints = {
        url(nullable:false, blank: false, maxSize: 2048)
        metadata()
    }
}

The schema that is generated looks like this:

+-------------+--------------+------+-----+---------+----------------+
| Field       | Type         | Null | Key | Default | Extra          |
+-------------+--------------+------+-----+---------+----------------+
| id          | bigint(20)   | NO   | PRI | NULL    | auto_increment |
| url         | longtext     | NO   |     | NULL    |                |
+-------------+--------------+------+-----+---------+----------------+

+--------------+--------------+------+-----+---------+-------+
| Field        | Type         | Null | Key | Default | Extra |
+--------------+--------------+------+-----+---------+-------+
| metadata     | bigint(20)   | YES  |     | NULL    |       |
| metadata_idx | varchar(255) | YES  |     | NULL    |       |
| metadata_elt | varchar(255) | NO   |     | NULL    |       |
+--------------+--------------+------+-----+---------+-------+

I am wondering how I can specify different types (specifically, different size) for the document_metadata table. I would like to be able to store strings longer than 255 characters. I could not find any relevant documentation online, possibly because I couldn’t come up with any good keywords. Map and Collection are pretty generic terms!

Thanks,

Gene

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T06:42:19+00:00Added an answer on May 25, 2026 at 6:42 am

    The only way you are going to be able to influence the DDL for your “metadata” is to make it a concrete domain class. Using HashMap isn’t going to give you the ability to do so.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have a Grails domain class with a HashMap of strings (HashMap metadata
In my Grails 1.3.7 project I have a domain class like this: class User
In my Grails domain I have something like the following class A { String
I have the following Grails domain class: class Product { String name Float basePrice
I've created a domain class in Grails like this: class MyObject { static hasMany
I have a Vote domain class from my grails application containing properties like article_id
I have a class like this : class User { String name; String password;
I have an Abstract Domain Class in Grails wich has fields that all the
I have a domain class in grails 1.5 that represents data from a table
I have a Grails domain class that is a hierarchy of categories. Each Category

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.