grails

Grails 3.3.3 generate-all <domain class> Creates only the Service Interface

﹥>﹥吖頭↗ 提交于 2021-01-28 11:48:44
问题 In Grails 3.3.3, when I run generate-all for a domain class, a Service Interface is generates (versus the actual Service Class from Grails 2.x). I actually didn't notice it until I tried to add a method to my service. The interface gets placed in the services folder where the service would live. I actually do like the interface but I still want the service and the default implementations. How can I have both an interface and implementation live in the services folder if the interface already

Grails 3.3.3 generate-all <domain class> Creates only the Service Interface

余生长醉 提交于 2021-01-28 11:44:16
问题 In Grails 3.3.3, when I run generate-all for a domain class, a Service Interface is generates (versus the actual Service Class from Grails 2.x). I actually didn't notice it until I tried to add a method to my service. The interface gets placed in the services folder where the service would live. I actually do like the interface but I still want the service and the default implementations. How can I have both an interface and implementation live in the services folder if the interface already

Grails not working on Ubuntu

≡放荡痞女 提交于 2021-01-28 01:56:42
问题 I'm new to Grails,but i have some problems... so i've started to install all of what is required to make it work : jdk8, setting the JAVA_HOME variable etc.. then i've installed Grails, created a new app with it and trying to run it,without modifying it, just to see if Grails was working fine, but unfortunately, nothing happened .. not even errors.. I've tried making it work changing the jdk to 1.7 version because I’ve read that it could be the main issue, but it's still the same.. Even when

Grails clean doesn't work

醉酒当歌 提交于 2021-01-28 00:10:31
问题 I'm using Grails -2.0.1 and when trying to run an app, I find a NoClassDefFoundError : Error 2012-10-16 15:24:25,301 [http-bio-8080-exec-9] ERROR errors.GrailsExceptionResolver - NoClassDefFoundError occurred when processing request: [GET] /workstation/track/computerName/login/MacOSX/true/username Could not initialize class workstation.server.TrackController. Stacktrace follows: Message: Error creating bean with name 'workstation.server.TrackController': Instantiation of bean failed; nested

How do I install grails in a Docker image?

三世轮回 提交于 2021-01-27 13:15:11
问题 I'm working on containerizing an existing application built on grails. I've been able to successfully build the project within a debian:stretch image (yes, I know that's old, but the project was originally built with old versions of just about everything) with gradle , maven , and default-jdk installed. However I'm unsure if that means I don't need grails. When I try grails --version from a command line prompt within the container it says "bash: grails: command not found". There does not

Modifying return value of getters of String fields

筅森魡賤 提交于 2021-01-27 12:11:13
问题 Let's say I have classes similar to domain classes in my application with some Long, Double, Date and String fields. These classes extend base class with some common fields and few common methods. Whenever I access class field (though getter) that is String, I want to make some changes to the value returned (for example remove html tags). Is there a better way than making implementations of getters for each fields of String type? What about inherited fields? 回答1: Don't change default getter

How to make multiple requests with different data in Grails Integration tests

♀尐吖头ヾ 提交于 2021-01-27 04:06:53
问题 I'm writing a Grails 2.2.1 integration test using the Spock plugin, in which I am trying to post two sets of data to the same controller endpoint: when: "The user adds this product to the inventory" def postData = [productId: 123] controller.request.JSON = postData controller.addToInventory() and: "Then they add another" def secondPostData = [productId: 456] controller.request.JSON = secondPostData controller.addToInventory() then: "The size of the inventory should be 2" new JSONObject(

How to do a simple table join in Grails

时光毁灭记忆、已成空白 提交于 2021-01-27 03:50:41
问题 I'm kind of new to grails and I'm having a lot of trouble with joining two existing tables through domain objects that have been created off of those tables. Does anyone know how to do this in grails? Here are what the tables look like and an example of how I need the joined table to look. Thanks in advance for the help. Table1{ field1table1 } Table2{ field1table2 field2table2 } I need to join these 2 tables where field1table1 = field1table2 and the resulting table join I need to look like

grails 4 groovy's date enhancement methods missing

只愿长相守 提交于 2021-01-03 05:25:37
问题 In a previous version of grails I was able to use the groovy enhanced version of java.util.Date found here here. After upgrading to grails 4, all those methods throw no signature of method on java.util.Date. Somehow the groovy additions aren't being picked up. def fdate=new Date(); out << fdate.format("MM/dd/yyyy") //No signature of method: java.util.Date.format() 回答1: Add a dependency to groovy-dateutil to your build.gradle : runtime 'org.codehaus.groovy:groovy-dateutil' The relevant

grails 4 groovy's date enhancement methods missing

假装没事ソ 提交于 2021-01-03 05:22:40
问题 In a previous version of grails I was able to use the groovy enhanced version of java.util.Date found here here. After upgrading to grails 4, all those methods throw no signature of method on java.util.Date. Somehow the groovy additions aren't being picked up. def fdate=new Date(); out << fdate.format("MM/dd/yyyy") //No signature of method: java.util.Date.format() 回答1: Add a dependency to groovy-dateutil to your build.gradle : runtime 'org.codehaus.groovy:groovy-dateutil' The relevant