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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:38:56+00:00 2026-06-11T08:38:56+00:00

I am using Grails 2.1.0 and Oracle 11. I have a domain class that

  • 0

I am using Grails 2.1.0 and Oracle 11.

I have a domain class that I am trying to connect to a table in an Oracle database. When the SQL is generated to populate the list() method I get ORA-00918: column ambiguously defined. The error occurs because the primary key of the table is requested twice with the same alias. Here is the generated SQL:

select * from ( select this_.BENCHMARK_CUSIP as BENCHMARK1_4_0_, this_.acronym as acronym4_0_, this_.as_of_date as as3_4_0_, this_.ask_price as ask4_4_0_, this_.ask_yield as ask5_4_0_, this_.benchmark_cusip as benchmark1_4_0_, this_.bid_price as bid6_4_0_, this_.bid_yield as bid7_4_0_, this_.coupon as coupon4_0_, this_.coupon_frequency as coupon9_4_0_, this_.is_on_the_run as is10_4_0_, this_.last_update_time as last11_4_0_, this_.last_update_user as last12_4_0_, this_.maturity as maturity4_0_, this_.name as name4_0_, this_.price as price4_0_, this_.source as source4_0_, this_.yield as yield4_0_ from BENCHMARK this_ ) where rownum <= ?

As you can see this_.benchmark_cusip as benchmark1_4_0 appears twice.

Here is my domain class

class Benchmark {
    String benchmarkCusip
    String acronym
    String name
    Double coupon
    java.math.BigDecimal couponFrequency
    Date maturity
    String isOnTheRun
    Date asOfDate
    Double bidYield
    Double yield
    Double askYield
    Double bidPrice
    Double price
    Double askPrice
    String source
    String lastUpdateUser
    Date lastUpdateTime

static mapping = {
    table 'BENCHMARK'        
    version false
   columns{id column:'BENCHMARK_CUSIP', generated:'assigned'}

}

The controller is just defined as def scaffold = true.

I assume that I have something misconfigured but for the life of me I can’t find it on the limited number of sites I can access from the office.

  • 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-11T08:38:58+00:00Added an answer on June 11, 2026 at 8:38 am

    Normally I do this:

    class Benchmark {
      ...
    
      static mapping = {
        table 'benchmark'
        id column: 'benchmark_cusip', name: 'benchmarkCusip'
      }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Grails database-migration I have a table in production defined like so: +--------------+------------+------+-----+---------+----------------+ |
We have developed a Web Application using grails, groovy and oracle as database with
When using Grails 1.1 together with a MySQL the charsets of the auto-generated database
I'm using Grails 1.3.7 and the db-migration plug-in. I have generated a chagelog.groovy-file containing
Using Grails and CXF, I have published a small web service that looks like
I have a Grails 2.0.0 project that was created using grails create-app . In
Using Grails 2.0.0 I am created service, that creates instances of Player class and
using Grails 1.1.1 I have domain in Grails Person. Person can be related to
When using Grails 1.0.4 together with a MySQL the charsets of the auto-generated database
I'm using Grails to set properties on a domain class if the property is

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.