grails

快速应用开发(RAD)平台

风格不统一 提交于 2020-02-26 08:26:26
过去几年中,现代软件开发的整体环境发生了巨大的变化。对我个人来说,这种变化与宇宙的加速膨胀差不多。第二个千年刚到来时,产业的发展看起来还不是那么快,只是逐步在前进。现在技术发展的复杂度和多样性已经可以用超音速来形容了,越来越快,出现了新的编程语言、开发工具、开发方法论等等。 由于类似 Uber、Facebook、Google 这样的企业需要构建全球解决方案的需求越来越多,使得技术变得更加全面也更加复杂。这种超级的复杂度,是能构建全球性巨大系统而必须付出的代价。但是对于构建相对简单的典型业务自动化系统,我们也应该付出相同的代价吗? 业务应用系统 - 自动化的沃土 2000年代初,在“能自动化就自动化”的格言激励下,业务自动化得到了极大的发展。这种自动化的结果就是所谓的业务应用系统(LOB Applications)。这是一个非常通用的术语,描述那些终极目的就是使得业务能更有效运行的非常重要的应用程序(大部分都是定制开发)。 通常, LOB 应用程序有下列特点: l 特定领域 - 为特定领域的专业人员服务,而不是大众市场 l 以数据为中心 - 高度依赖关系型数据库,并且关系型数据库是应用程序的关键核心 l 面向事务( OLTP) - 代表系统的一致性和可用性级别(高一致性、高可用性),假设每个事务都符合 ACID l 全面的业务逻辑 - 包含大量自定义的业务逻辑和数据处理算法 l

Grails nullable:true not working after modifying domain class

ぐ巨炮叔叔 提交于 2020-02-25 02:37:28
问题 I have a domain class with few fields. The application was running and then I had to add 2 more fields to the domain class which were marked as nullable: class SomeDomain{ // Fields from beginning ............. // Two fields added afterwards String fieldA String fieldB static constraints = { // Constraints on initial fields ............... // Constraints on fields added afterwards fieldA(nullable: true) fieldB(nullable: true) } } But when I run this, then I see the fields added to mysql table

Grails nullable:true not working after modifying domain class

天大地大妈咪最大 提交于 2020-02-25 02:37:22
问题 I have a domain class with few fields. The application was running and then I had to add 2 more fields to the domain class which were marked as nullable: class SomeDomain{ // Fields from beginning ............. // Two fields added afterwards String fieldA String fieldB static constraints = { // Constraints on initial fields ............... // Constraints on fields added afterwards fieldA(nullable: true) fieldB(nullable: true) } } But when I run this, then I see the fields added to mysql table

Not able to build grails 2.3.7 project since the maven central repository has moved to https

强颜欢笑 提交于 2020-02-25 01:51:52
问题 I am not able to build my 2.3.7 grails projects since the maven central repository has moved to https. I tried the recommandations on this post : Requests to http://repo1.maven.org/maven2/ return a 501 HTTPS Required status and a body However I'am still having an issue because the maven repo is coded in the framework jars ( grails-aether-2.3.7-sources.jar ) The class is org.codehaus.groovy.grails.resolve.maven.aether.config.RepositoriesConfinguration.groovy . RemoteRepository mavenCentral

How to partially mock service in Grails integration test

假如想象 提交于 2020-02-23 06:55:30
问题 I am attempting to write a test for a controller which calls a service method. I would like to mock a dependent method within that service. My spec is as follows: MyController myController = new MyController() def mockMyService def "My spy should be called"() { when: mockMyService = Spy(MyService) { methodToSpy() >> { println "methodToSpy called" } // stub out content of this fn } myController.myService = mockMyService myController.callService() then: 1 * mockMyService.methodToSpy() } When I

Executing SQL inserts during Grails application startup

空扰寡人 提交于 2020-02-21 13:09:13
问题 I am in development phase, trying to use in-memory DB and load it with some data during Grails application start up. My question is, is there any way to write/configure SQL insert statements that can be executed during startup. 回答1: You can do this in BootStrap.groovy. If you add a dependency injection for the dataSource bean you can use it with a groovy.sql.Sql instance to do inserts: import groovy.sql.Sql class BootStrap { def dataSource def init = { servletContext -> def sql = new Sql

Executing SQL inserts during Grails application startup

时光怂恿深爱的人放手 提交于 2020-02-21 13:02:22
问题 I am in development phase, trying to use in-memory DB and load it with some data during Grails application start up. My question is, is there any way to write/configure SQL insert statements that can be executed during startup. 回答1: You can do this in BootStrap.groovy. If you add a dependency injection for the dataSource bean you can use it with a groovy.sql.Sql instance to do inserts: import groovy.sql.Sql class BootStrap { def dataSource def init = { servletContext -> def sql = new Sql

Executing SQL inserts during Grails application startup

本秂侑毒 提交于 2020-02-21 13:01:04
问题 I am in development phase, trying to use in-memory DB and load it with some data during Grails application start up. My question is, is there any way to write/configure SQL insert statements that can be executed during startup. 回答1: You can do this in BootStrap.groovy. If you add a dependency injection for the dataSource bean you can use it with a groovy.sql.Sql instance to do inserts: import groovy.sql.Sql class BootStrap { def dataSource def init = { servletContext -> def sql = new Sql

How to make my URL mapping case insensitive?

蓝咒 提交于 2020-02-13 11:42:49
问题 Grails, by default, is case-sensitive when mapping URL to controller actions or views. For instance, www.mywebsite.com/book/list will work BUT www.mywebsite.com/Book/list will return a 404 page. What can I do (code snippets are welcomed) to make my URL case-insensitive (i.e. www.mywebsite.com/Book/list being a valid url) ? 回答1: Just a shoot from the hip, try the following: static mappings = { "/$controller/$action?/$id?"{ controller = controller.toLowerCase() action = action.toLowerCase() }

Configuring CK Editor plugin in Grails

你。 提交于 2020-02-08 02:46:08
问题 How do we configure the CK Editor plugin in Grails? I'd like to use a couple of add-ons and customise the skin (theme) as well. The documentation by Stefano Gualdi, which seems to be the most prominent material, isn't too helpful. Also, I did find a builder which will let us customize (http://ckeditor.com/builder), but I couldn't find anything similar for CK Editor in Grails. Also, the builder gave the impression that I customize my package according to my needs, download it, and copy it onto