I'd like to do something like this:
def results = Item.findAll("from Item c, Tag b, ItemTag a where c = a.item and b = a.tag and (b.tag like :q or c.uri like :q) " + ob,[q:q])
def items = (Item) results[0..1][0]
but I get
Cannot cast object '[Ljava.lang.Object;@1e224a5' with class '[Ljava.lang.Object;' to class 'org.maflt.ibidem.Ite...
Hi All,
If anyone has or is running a Grails application on their server I would appreciate some details on where to go after creating the WAR.
Background
I chose grails because with Google App Engine and the App Engine Plugin deployment should have been trivial. This issue is that there is a bug which makes any application pretty muc...
Hello All,
I am trying to get hold of rails counter cache feature but not able to grasp it completely.
Let's say that We have 3 models
A B C
A belongs to B or C depending upon a field key_type and key_id. key_type tells whether A belongs to B or C so if key_type="B" then the record belongs to B otherwise it belongs to C.
In my mode...
Hi,
I have the following domains classes:
class Posts{
String Name
String Country
static hasMany = [tags:Tags]
static constraints = {
}
}
class Tags{
String Name
static belongsTo = Posts
static hasMany = [posts:Posts]
static constraints = {
}
String toString()
{
"${...
This is in my gsp and it doesn't work
<g:select name="head.id" from="${com.hive.Persons.findAllByFirstname(${variable})}" optionKey="id" value="${organizationInstance?.head?.id}" />
I think that the main reason is that I am nesting ${}. How can I accomplish this.
${variable} is a string passed from the controller.
thanks!
...
When I add the Cometd plugin to Grails 1.2.1, grail's "jetty" debug environment will no longer start up.
I have been unable to debug this, not being familiar enough with the underlying components. (This is a big issue with Grails development in general. While it tries to hide everything from you, pretty soon you have to become an exper...
I have an organization class
class Organization {
hasMany = [member:Members]
}
class Members {
belongsTo = organization
}
I'm printing all the members using
<ol>
<g:each in="${organizationInstance?.members?}" var="m">
<li><g:link controller="members" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li>
</g:each>
</ol>
...
Hi,
I tried with using groovy SQL . This worked on my machine and also on test site too very good. But failed when moved war to Beta site.
Here are the steps i did for portlet .
In portlet file:
import javax.portlet.*
import groovy.sql.Sql
class MaintenancePortlet {
def dataSource
def db = new Sql(dataSource)
def organizat...
I am writing pagination code and I am using grails paginate tag. I am calling one method on click of navigation links. I want to access input fields in that method. I used g:paginate params="[myField:myField] and when I access in controller in that method as params.myField, it shows blank values. How to access? I am newbie. Help me.
...
Hi,
When I write the following class, I get the following compilation error:
could not resolve property
How can I achive the following:
class Employee{
String Name
String Email
Employee Manager
static hasMany = [desginations:Designation]
static constraints = {
Name(unique:true)
Email(unique:true)
}
Thanks...
So, we have a grails app set up with a Hudson CI build process. We're running unit tests, integration tests, and about to set up Selenium for some functional tests as well.
However, are there any good ways of fully testing a sites links to make sure nothing has broken in a release.
I know there's link checkers in general, but I'd like ...
Hi, can anybody tell me why this works
<g:each var="n" in="${com.pp.News.list()}">
<h2>${n.t}</h2>
<p>${n.tx}</p>
</g:each>
but this doesn't ?
<g:set var="news" value="${com.pp.News.findAllByShow(true,[sort:'prio', order:'desc',max:5])}" />
<g:each var="n" in="news">
<h2>${n.t}</h2>
<p>${n.tx}</p>
</g:each>
Part of the e...
My Grails app works great in development both in IntelliJ and in Tomcat directly on windows.
Then we run it in QA on Linux
Most classes in the application map just fine and much of the application is working right up until we hit a feature that uses the class Channel.
Then we get the error
"org.hibernate.hql.ast.QuerySyntaxException:...
I have been searching the web for recent benchmarks measuring Grails overall performance compared to its competitors (Rails, Django, ASP.NET MVC...), but I didn't find anything more recent than a 3 years-old article with obsolete grails version (0.5). See here and here.
So, starting from grails 1.2, are there any more recent grails ben...
Using jetty Cometd with my grails application. Logs are full with org.mortbay.jetty.RetryRequest unhandled exception. Everything works good. As I know this exception must be thrown and must be unhandled for cometd to work. I'm just interesting how to prevent it form being logged?
...
HI I'm using gui's datatable in grails, but when I try to run the code, I get this exception:
org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: org.grails.grailsui.ResourcesTagLibService.stylesheetTag() is applicable for argument types: (java.lang.String, java.lang.String...
Hi I'm using grails navigation plugin and when it generates menus it put the sub navigation underneath the main menu, but i'm making my menu a vertical menu so i don't want the sub menu under the whole menu i want it under the active element.
Example: this is how it generate the menu and sub menu
<ul class="mainmenu">
<li>item1</li>...
Specifically, I want to have my grails app under development to connect to an Oracle db defined by an tnsnames.ora file. I have the tnsnames.ora file located in c:\drivers\Network\ on my PC. When I run the grails app via "grails run-war", the db connection string defined in the tnsnames.ora file doesn't seem to be picked up:
grails p...
I'm not very good in SQL and HQL...
I have two domains:
class Hotel {
String name
}
class Room {
Hotel hotel
float price
}
How many hotels have at least one room ?
...
I'm following the racetrack example from Jason Rudolph's book at InfoQ, using grails-1.2.1. I got up to the part where I was to switch from hsqldb to mysql. I think I've deleted every reference to hsqldb in the DataSource.groovy file, but I get an exception and the stack trace shows it's still using hsqldb.
DataSource.groovy
dataSourc...