简体   繁体   中英

Grails 2.3.8 domain class has name Order

I am failing an integration test because in my project there is a domain class named Order. That is a known keyword in SQL. The exception generated even hints at an SQLGrammarException. One obvious solution is to rename the class. Is there any solution that will allow me to keep the name of the class as is?

You can escape the name by specifying a mapping

class Order {
   static mapping = {
       table "`Order`"
  }
}

Source: https://jira.grails.org/browse/GRAILS-2737

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM