Questions tagged as 'groovy'

1
answer

When using Interfaces

I always had the following question: When should I really use an interface rather than inheritance and what advantages can I get?     
asked by 08.05.2015 / 06:25
1
answer

Is it possible to tell the size of the VARCHAR in a NamedParameter?

I'm working on a tuning of a SQL Server database. Through the query below, I can see how the bank ran some of my heaviest queries. SELECT TOP 30 deqt.TEXT AS Query, last_execution_time FROM sys.dm_exec_query_stats deqs C...
asked by 01.11.2017 / 13:14
3
answers

When should I use new?

What happens here? Why an instance of Date is created in this example: String dataFormatada = new Date().format("dd/MM/yyyy") In this example we did not use new : def data = Date.parse('dd/MM/yyyy', '31/12/1980') When shou...
asked by 16.12.2015 / 12:52
6
answers

How to remove 2 digits from each list item?

I have a list / array: var lista['01.um','02.dois','03.tres'] I need to create a new list like this: lista['01','02','03'] I know little about Groovy and Java, what is the correct way to create the list?     
asked by 19.06.2016 / 20:55
1
answer

Criteria do grails

Somebody please tell me what this $ {result [0] [0]} means, why did they put two pair of brackets? def criteria = Person.createCriteria() def result = criteria.list { projections { max('age') min('age') } } println "The maximum age i...
asked by 01.01.2016 / 21:21
1
answer

How to create POST, PUT and DELETE method in Grails application?

I have a Grails 2.4.2 application that I want to communicate with another application, and this interaction should occur through a Rest service provided by Grails. Today the way it is implemented I just inform .json at the end of the URL that it...
asked by 18.08.2015 / 20:06
2
answers

Transform String into Array - Groovy

I have String as follows: [["155","123RET"],["156","124RET"]] In other words, I need to add an item in each of them, so I need them in the end to be as follows: [["1","155","123RET"],["2","156","124RET"]] I need to convert this...
asked by 21.11.2017 / 17:54
1
answer

Problems installing Grails

I've set the GRAILS_HOME and JAVA_HOME faults I already used for Griffon , however when trying to access Grails I get the following error:     
asked by 13.06.2014 / 15:08
1
answer

Spring instantiate object with @Value

In my application.properties has algumaCoisa=joao , and when I java -jar nomedo.jar , it comes null, can anyone explain to me why this happens and how do I fix it? @Component class TesteClass{ @Value("${algumaCoisa}")...
asked by 25.06.2017 / 15:11
1
answer

Sql Groovy, pass the value of an IN parameter

I have the following code: def pessoaIds = [1, 2, 3, 4, 5] def query = "SELECT * FROM Pessoa WHERE id IN(?)" def pessoaList = sql.rows(query, [pessoaIds]) In this case "PersonList" returns an empty list; def query = "SELECT * FROM Pessoa...
asked by 16.03.2015 / 17:29