Dear All:
Using the following code:
@Entity
@Table(uniqueConstraints=[@UniqueConstraint(columnNames=["account","name"])])
class Friend {
@Id @GeneratedValue(strategy=GenerationType.AUTO)
public Long id
@ManyToOne
public Account account
public String href
public String name
}
I get the following error:
org.hibernate.Anno...
Is there a way to modify the code from a previous answer
import groovy.xml.MarkupBuilder
def writer = new StringWriter()
def builder = new MarkupBuilder(writer)
def awaiting = ['one', 'two', 'three']
builder.html {
ul {
awaiting.each {
li(it.toString())
}
}
}
println writer.toString()
so that i...
How can I print out the (public and internal) variables and their values of a Groovy object?
I.e
class X
{
def X = 10
def Y = 5
private void doPrivate()
{
def Z = 3
}
}
Should give
X, 10
Y, 5
Z, 3
This has to be a dynamic solution, i.e at runtime.
...
I'm just wondering if it's possible for 'createCriteria' to specify the contains group similar to CharIndex('P', Channel) <> 0
I am using eq and get exact match but what should i use in i need to get all the records which contains channel similar to IN("channel",('a','b','c','d'))
def c = Load.createCriteria()
def results = c {
...
Dear All:
I would like to have a text field whose value always reflects that of a certain field in a given object. I thought Bindable might be the way to do this. However, using the following example:
#!/usr/bin/env groovy
import groovy.swing.SwingBuilder
import groovy.beans.Bindable
import static javax.swing.JFrame.EXIT_ON_CLOSE
cla...
Dear All:
I would like to implement a Glazed List that has both an AdvancedTableFormat and WritableTableFormat interface.
I am reading here:
http://www.jroller.com/aalmiray/entry/glazedlists_groovy_not_your_regular
and for one interface it seems this is possible in Groovy with the "as" keyword:
# return new EventTableModel(linksList,...
Using grails 1.2.2 with groovy 1.6.8 .. Reading a a web service and trying to process response ..
Response is shown below and validates as correct xml .. (sorry for length) ..
<soap:Body>
<AddProductEventResponse xmlns="http://tempuri.org/">
<AddProductEventResult>
<xs:schema id="AddProductEventResult" xmlns=""...
Hello,
I just embedded Groovy in my application and wondering if it's possible to restrict access to some APIs i.e. java.io.File, java.net.URL, etc
Or instead of completely restricting java.io.File access, I want to ONLY allow access to certain directories on the machine.
Any guidance is greatly appreciated!
...
I need to display name, size, date of files using ls -l unix command in groovy .
How can we run ls -l in groovy to view info ?
thanks in advance.
...
Will groovy (grails) give you compile time checking like java?
If you always specify the type, will that change things much?
...
I'm making a console-based Java/Groovy application that does a lot of find/replaces in text files. If, say, the program knows you replaced foo with bar last time, it should by default know you probably want to replace the next foo with bar as well. My idea was to pre-populate the input field of the What would you like to rename this to? ...
Is it possible to execute groovy code dynamically loaded in java application.
For example there is a database table which contains small pieces of groovy code, like:
def test(${val_to_insert_from_java}){
if (${val_to_insert_from_java} > 10){
return true;
}
return false;
}
Where ${val_to_insert_from_java} is a place...
def names = ["myname", "yourname", "theirname", "allnames"]
String n = ""
names.each{
n += it + ","
}
println n
Output:
myname,yourname,theirname,allnames,
How do I get rid of the leading comma
...
one thing I hate about java development are their IDE's, and configuration/setup involved to initially get going.
does grails have these issues? from the looks of it, it seems you need a command line open and then any text editor will do. (apart from a mysql and tomcat install).
are these assumptions correct or its better to get eclips...
I'm trying to make an in statement with values coming from DB and then use them in another query. DB is Oracle
Example:
I've been beating my head around this for quite some time now. I need some help:
Groovy Code:
def myList = []
def myQuery = "select USER_ID from USER_TABLE where rownum < 3"
println myQuery
sql_dw.eachRow(myQuery) {...
I have an XML template document:
<TriadMessage xmlns="http://www.myco.com/02/11/2008/V1/TriadMessage.xsd"
xmlns:triad="http://www.myco.com/02/11/2008/V1/TriadTypes.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<TriadRouteInfo>
<triad:RoutingCorrelationId>new value goes here</triad:RoutingCorrelationId...
Hello there,
I am trying to make a filter for my data so other people can see it, lets say I have a bunch of Events, like a calendar, and I want to see all that have a name or title with the word "Soccer".
I've been trying to figure out how to do it but nothing works for me, I also tried to use filterPane plugin but did not work quite a...
Is there a way to record a response (even non permanently during one "test-session") in a way that I can use an assertion like "please validate that the (new) response is exactly like this (old recorded) one".
The use case is a regression test for changes which apply to several web services, which then have to be retested to be sure ther...
Hi all,
I'm trying to convert a domain class into JSON.
def converter = null
try{
converter = events as JSON
} catch(e) {
log.error "error during conversion to JSON"
log.error e
}
return converter.toString()
I always get this error:
org.codehaus.groovy.grails.web.servlet.mvc.exceptions.ControllerExecutionException: Executin...
I have a table, with a series of events,
name of my class is Entry.
Here is a picture of my table
is in Spanish, but the basics are the same so it shouldn't be a problem.
(the filter HTML code is not yet so its a mess but it works)
and here are the results that I get when I look for the entry.
Now my problem is that I need the resu...