groovy

what can be the regex for the following string

I am doing this in groovy. Input: hip_abc_batch hip_ndnh_4_abc_copy_from_stgig abc_copy_from_stgig hiv_daiv_batch hip_a_de_copy_from_staging abc_a_de_copy_from_staging I want to get the last column. basically anything that starts with abc_. I tried the following regex (works for second line but not second. \abc_.*\ but that ...

most of my "interesting tags" have no (or one) questions

this started happening a day or so ago. java has lots, but groovy, math, oop, and grails have zero or one. ...

problem installing eclipse groovy plugin in galileo

hello all, trying to install groovy plugin in eclipse 3.5, i am using the update site [http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.5/%5D%5B1%5D it does install but when it tries to restart i get an exception. !SESSION Sat Aug 29 15:47:17 PDT 2009 ------------------------------------------ !ENTRY org.eclipse.eq...

How to incorporate a g:link into an ordinary button?

I'm working on a grails application and I've kept looking for some solution to my problem for the past 15minutes - I guess, there's an pretty simple solution to this... The point is, I have a view where I have a g:link tag - it works fine, but the visuals are kind of ugly. Therefore I want to disguise that g:link thingy with a normal bu...

call name of method contained in a string

How can I call a method based on the value of a string in Groovy? For example instead of switch (val) { Case "one": Obj.one() break Case "two": Obj.two() Break } I’d like to do something like obj.val where val contains either "one" or "two" instead of a case statement. ...

Having Trouble Generating a War in Grails

I'm getting the following error when I try to build a war in Grails. Any thoughts on what could be causing the issue? Any tips on debugging the Groovy scripts that are building the war? [web] $ cmd.exe /C D:\dev\tools\grails-1.1\bin\grails.bat war cloudfi.war && exit %%ERRORLEVEL%% Welcome to Grails 1.1 - http://grails.org/ Licensed u...

Groovy Eclipse Stubbed Method

I have some groovy files in Eclipse and my project has the Groovy nature. I don't use the GroovyBuilder (I don't think you need to now. there were problems in the past when java files referenced groovy and vice versa). Sometimes when I run my project I get a "Stubbed Method" error and I need to do a project clean for the groovy files to ...

regex to find a word in a sentence

I have a string like following: CREATE GLOBAL TEMPORARY TABLE some_temp_table_name OR CREATE GLOBAL TEMPORARY TABLE some_temp_table_name something else with the regex I want to strip out whatever is in bold letters. I have the following regex ([a-z].*[\s]*) what should I change in the regex? ...

regex over multiple lines in groovy

I have a multiple line string like following: END IF; **EXECUTE IMMEDIATE ' CREATE INDEX #idx1 ON somename ( row_id, something)';** IF v_sys_error <> 0 THEN GOTO SQL_ERROR; END IF; Edit: '**' is not in my string. I wanted to bold what i wanted to capture. I wish to capture the part in ...

How To Determine A Parent Class in Grails

I have a base class that all of my domain classes extend, for example: class Customer extends IbidemBaseDomain { . . } Is there any way within my base class to determine what class is extending it. So in this example, is there anyway for IbidemBaseDomain to know that it's being extended by Customer? ...

Groovy Jasper plugin

Hi! I have updated from grails 1.1 to grails 1.1.1 and I also updated the jasper plugin from version 0.95 to version 0.97 Now I am getting an exception when calling the plugin (see below). Any Idea what is wrong? Thanks! Luis 2009-09-02 18:54:57,846 [2804015@qtp0-4] ERROR errors.GrailsExceptionResolver - java.lang.NullPointerEx...

Groovy - bind properties from one object to another

Is there a way to bind properties from one instance of a class to the properties of an instance of another class (the common fields between the two). See the example below: class One { String foo String bar } class Two { String foo String bar String baz } def one = new One(foo:'one-foo', bar:'one-bar') def two = new Two() ...

Hibernate Groovy entities

Hi All! I'm have a groovy hibernate entity, named 'Depart' for example. Now when i'm try to get their property (for example Long id = somedepart.getIdDepart() ) i'm got an exception Cannot cast Depart to Depart_$$_javassist_5 Who make Depart_$$_javassist_5 - groovy or hibernate? Is there some workaround about this? ...

Grails - multiple belongsTo of same class with cascading deletion

Hi all, This one is for the Grails users here. I asked it on the grails - user mailing list, but I figured since I've been fighting this for a couple of days I should cast as wide a net as possible. I'm having some difficulty with trying to model relationships between two objects of the same type in another object (different type) ref...

How do I enumerate the groovy classes in a specific package?

If I have a package (foo.bar), is there some groovy sugar that makes it easy for me to enumerate all the classes in said package? ...

Groovy/Grails date class - getting day of month

Currently I'm using the following code to get year, month, day of month, hour and minute in Groovy: Date now = new Date() Integer year = now.year + 1900 Integer month = now.month + 1 Integer day = now.getAt(Calendar.DAY_OF_MONTH) // inconsistent! Integer hour = now.hours Integer minute = now.minutes // Code that uses year, month, day, h...

Groovy findAll closure parameters

Hi All! I'm want use groovy findAll with my param to filtering closure filterClosure = { it, param -> it.getParam == param } How now i'm can call this closure in findAll? Something lik bellow? myColl = someColl.findAll(filterClosure ??? ) ...

Groovy domain mapping

Hi! I have a to save a pdf report into an Oracle DB. The report's dataType is a byteArray. The domain definition is as follows: static constraints = { report(nullable:false) company(nullable:false) month(nullable:false) } byte[] report Company company Date month } Unfortunately this defines in the Oracle DB a field whic...

Hotfixing Code running inside Web Container with Groovy

I have a webapp running that has a bug. I know how to fix it in the sources. However I cannot redeploy the app as I would have to take it offline to do so. (At least not right now). I now want to fix the code "at runtime". Surgery on the living object, so to speak. The app is implemented in Java and is build on top of Seam. I have add...

Invoke method as closure

Hi, My understanding of the Groovy operator .& is that it converts a method call to a closure. Therefore it seems like the following code (which can be run in the Groovy console) should work: class Foo { def method(def param) { param + 10 } } def invokeClosure = {Closure closure -> return closure.call() } def f = new Foo()...