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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:09:14+00:00 2026-06-08T19:09:14+00:00

I’m writing my first Grails app and I’ve reversed my existing Postgresql schema using

  • 0

I’m writing my first Grails app and I’ve reversed my existing Postgresql schema using the Grails Application Generator. (GRAG) When I run the app, I get the error:

Invocation of init method failed; nested exception is
org.hibernate.HibernateException: Wrong column type in
public.event_staff for column event_staff_id. Found: serial, expected:
int8

I’m guessing this is due to “serial” not being a real type in Postgresql and more of an alias for an auto incrementing integer value that is tied to a sequence. I imagine there is a clean way to work around this issue, but having no experience with Hibernate I’m not sure the best way to move forward.

Here’s the class in question:

 class EventStaff {
        static mapping = {
             table 'event_staff'
             // version is set to false, because this 
             // isn't available by default for legacy databases
             version false
             id generator:'identity', column:'event_staff_id', name: 'eventStaffId'
             staffMemberIdStaffMember column:'staff_member_id'
             gameIdGame column:'game_id'
        }

        Long eventStaffId
        Boolean shouldNotify
        Date created
        Date modified
        // Relation
        StaffMember staffMemberIdStaffMember
        // Relation
        Game gameIdGame

        static constraints = {
            eventStaffId()
            shouldNotify()
            created()
            modified()
            staffMemberIdStaffMember()
            gameIdGame()
        }

        String toString() {
            return "${eventStaffId}" 
        }
    }
  • 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-08T19:09:16+00:00Added an answer on June 8, 2026 at 7:09 pm

    Hibernate is not being able to convert ‘serial’ to a valid Java type. It’s kind of an old problem. If you can, change your database id type to bigint or bigserial instead of serial, like this guy did, it will probably solve your problem. If not, try specifying the type of the column with:

    id generator:'identity', column:'event_staff_id', 
    name: 'eventStaffId', type: 'serial' //though I don't know if 'serial' will work in this dialect.
    

    Still you can try to change your id type to Integer instead of Long.

    Try these tips separately.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I am writing an app with both english and french support. The app requests
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I would like to run a str_replace or preg_replace which looks for certain words

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.