grails-3.0

Grails 3 - return list in query result from HQL query

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 07:00:55
问题 I have a domain object: class Business { String name List subUnits static hasMany = [ subUnits : SubUnit, ] } I want to get name and subUnits using HQL, but I get an error Exception: org.springframework.orm.hibernate4.HibernateQueryException: not an entity when using: List businesses = Business.executeQuery("select business.name, business.subUnits from Business as business") Is there a way I can get subUnits returned in the result query result as a List using HQL? When I use a left join, the

Grails 3.0.0.M1 - create-plugin - Could not find method bintray

空扰寡人 提交于 2019-12-12 21:08:48
问题 In the frustration, that I am not able to add a filter and mapping to the gone web.xml I wanted to create a plugin, only to be able to use doWithWebDescriptor() (My first plugin for my first application) I am not good enough to discern, if the following is worth a JIRA, or I screwed something again. Can someone decide this one for me please? Thank you $ grails create-plugin plug | Application created at /home/rawi/work/grails/plug $ cd plug $ grails --stacktrace Resolving dependencies. Please

how to set a grails 3 app to use a root context path?

最后都变了- 提交于 2019-12-12 15:28:35
问题 I'm trying to set a root context path for my application in `conf/application.yml' like so: server: 'context-path': '/' However, when trying to start grails> run-app , I get the following exception: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':bootRun'. > Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_20.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1 回答1: From Grails 3.0.3, the expected configuration key is contextPath

Grails 3.0.0.M1 - Install scaffolding templates into my Grails project

蓝咒 提交于 2019-12-12 10:39:29
问题 The only templates I can get in Grails 3 with install-form-fields-templates are create.gsp and edit.gsp from the fields-plugin . Is there any chance to install and use again the old ones with _form.gsp ? The fields plugin is not in build.gradle . So is it now part of the grails-core and only possibility? Thanks! 来源: https://stackoverflow.com/questions/28414162/grails-3-0-0-m1-install-scaffolding-templates-into-my-grails-project

UrlMappings to point a URL to an asset pipeline file in Grails

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 08:43:04
问题 In Grails 3.0 how do you map a URL to a file under the assets folder? For example: http://localhost:8080/favicon.ico --> grails-app/assets/images/bookmark.ico I've tried a few test mappings, such as: grails-app/controllers/UrlMappings.groovy class UrlMappings { static mappings = { ... "/t1.png" (uri: "/assets/images/test.png") "/t2.png" (uri: "/assets/test.png") "/t3.png" (uri: "/images/test.png") "/t4.png" (dir: "assets/images", file: "test.png") ... } } ...but they all result in a 500

combine @TestFor and @Integration Annotation grails 3

对着背影说爱祢 提交于 2019-12-12 06:35:52
问题 I migrate a large Grails 1.3.7 project to 3.1.6. Tests for Controllers are integration tests. This works fine because the tests inherit from ControllerSpec. Now i´m should be able to do something like this: @Integration @TestFor(SampleController) class SampleControllerIntSpec extends Specification { Because the TestFor Annotation allows usage of model/view/.. fields like in Unit tests. Is there a way to do something like this? Thanks in advance. 回答1: No the TestFor annotations are exclusively

Grails 3 - get asset path in service

别说谁变了你拦得住时间么 提交于 2019-12-12 03:27:00
问题 I need to get the path of a static resource located in assets/schemas/resource.json in a Grails 3 service. At the moment it is defined as private final String SCHEMA = 'grails-app/assets/schemas/resource.json', which is fine for development environment, but of course not for production (as it would be located in <app_root>/assets/resource.json . I tried to search how to exploit the Asset Pipeline in my case, but up to now I really have no idea :P Thanks in advance! 回答1: It is covered in the

Grails Geocode plugin dependency injection issue

元气小坏坏 提交于 2019-12-12 03:08:11
问题 Grails Version: 3.0.7 Groovy Version: 2.4.4 JVM Version: 1.8.0_51 I must be missing something really simple here. I've added a grails plugin to my project as defined in the read me : compile 'org.grails.plugins:geocode:0.3' I can see the relevant dependencies have been pulled down from the repository. However, when trying to inject the service within my controller using : def geocodingService I receive the following error upon execution : Caused by: java.lang.NullPointerException: Cannot

Headers in POST in Grails 3 app are not being sent with rest of service

白昼怎懂夜的黑 提交于 2019-12-12 02:47:29
问题 Using Grails 3.0.9, and grabbing the freshest REST API with this snippet in gradle.build : compile 'org.grails:grails-datastore-rest-client:4.0.7.RELEASE', { ['commons-codec', 'grails-async', 'grails-core', 'grails-plugin-converters', 'grails-web', 'groovy'].each { exclude module: it } } I am trying to make the following POST request: def rest = new RestBuilder(headers:["X-LSS-Env":"devmo"], connectTimeout:10000, readTimeout:20000) response = rest.post("http://..../..") { accept "application

How do I configure installation of plugins in Grails 3.0.4?

∥☆過路亽.° 提交于 2019-12-11 13:57:53
问题 I'm porting an application from Grails 2.4.2 to Grails 3.0.4, and I'm having problems with some plugins that were installed previously. Specifically one that is referenced in a GSP page. The particular plugin is called google-visualizer, and I've found some info here: https://github.com/bmuschko/grails-google-visualization/blob/master/grails-app/views/formatter/index.gsp However, I am clueless as to how to install this. I have not found the particular jar file in any maven repo, so I can't