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 8599153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:19:50+00:00 2026-06-12T01:19:50+00:00

I am using Grails 2.1.1 and MySQL 5.5.27 Community Server . I need to

  • 0

I am using Grails 2.1.1 and MySQL 5.5.27 Community Server.

I need to have a Domain class field generate a TEXT or LONGTEXT column.

I thought this would be simple, and I’ve seen numerous examples:

Grails domain class, String field TEXT and LONGTEXT

How can grail generate TEXT not LONGTEXT data type or column

However, I’ve run into dead-ends all night. I followed all these examples and none seem to work (even though others have reported that it works).

Here is a sample Domain Class I created:

class Coltest {

    static constraints = {
        description1 sqlType: 'longtext'
        description2 sqlType: 'text'
        description3 type: 'text'
        description4 column: "longDescription", type: "text", nullable:true
    }

    String description1
    String description2
    String description3
    String description4
}

Here is what I get in MySQL command interface:

mysql> describe coltest;
+--------------+--------------+------+-----+---------+----------------+
| Field        | Type         | Null | Key | Default | Extra          |
+--------------+--------------+------+-----+---------+----------------+
| id           | bigint(20)   | NO   | PRI | NULL    | auto_increment |
| version      | bigint(20)   | NO   |     | NULL    |                |
| description1 | varchar(255) | NO   |     | NULL    |                |
| description2 | varchar(255) | NO   |     | NULL    |                |
| description3 | varchar(255) | NO   |     | NULL    |                |
| description4 | varchar(255) | YES  |     | NULL    |                |
+--------------+--------------+------+-----+---------+----------------+
6 rows in set (0.01 sec)

No matter what I try, I always seem to get a column of type varchar(255).

Apologies if I’m missing something silly, but I’ve been staring at this all night, and think I’ve tried everything that others have reported to work.

Any insight would be appreciated tremendously. Thank you in advance.

  • 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-06-12T01:19:51+00:00Added an answer on June 12, 2026 at 1:19 am

    I think that the issue is that ‘sqlType’ belongs in a mapping, not a constraint.

    Try either:

    static constraints = {
      description2 size: 1..5000
    }
    

    or

    static mapping = {
      description2 sqlType:"text"
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem in Grails 1.1.2 + MySQL. My domain class Something contains
How can I map a mysql field of type enum to a grails domain
I am using Grails 1.3.7 with hibernate 1.3.7 with MySQL 5.1. I have the
I'm using grails 2.0 with mysql and i want some Domain attributes to be
When using Grails 1.1 together with a MySQL the charsets of the auto-generated database
Using Grails database-migration I have a table in production defined like so: +--------------+------------+------+-----+---------+----------------+ |
I'm considering using Grails for my current project. I have a couple of requirements
I'm using Grails 1.3.7 and the db-migration plug-in. I have generated a chagelog.groovy-file containing
We are using Grails with a legacy database and we need to control how
Using Grails and CXF, I have published a small web service that looks like

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.