groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nelson, Erick" <>
Subject Convert @Grab to Grape.grab ?
Date Mon, 20 Jan 2020 20:36:25 GMT
Is it possible to convert a Grab annotation to a Grapes.grab call?

Convert this…

import groovy.sql.Sql

to this…

groovy.grape.Grape.grab(group:'', module:'ojdbc6', version:'')

I’m assuming I’d need to add map entries for classLoader: and refObject: but I’m not
sure how to assemble these if needed.

I’d like to put the Grapes.grab call in my compiled library.  Is this even possible?

My library connects to oracle like this…

Sql.withInstanceOracle(user:'tauser03',name:'ecprd4') { sql -> }

The static method withInstanceOracle is a metaClass method that under the hood calls this…

    static Sql newInstance (Map map) {

        // groovy.grape.Grape.grab(group:'', module:'ojdbc6', version:'')

        Map connectionMap = buildConnectionMap(map) "connecting to [${connectionMap.url}] as [${connectionMap.user}]"

        Sql sql = Sql.newInstance(connectionMap)




In my Oracle class.
View raw message