Thursday, August 27, 2009

MySql query to create a sequence of integers

The following sql query would generate a sequence of integers. This can be combined with other sql queries as a subquery.

select @rownum:=@rownum+1 as seq from (select @rownum:=-1) seed, SomTable t1,SomeTable limit


SomeTable can be any table that has enough rows so that the cross product is greater than the upper bound.

Tuesday, July 7, 2009

grails plugins eclipse class path settings

Grails 1.1 the plugin files are not part of the source tree, instead they are exploded under user.home\.grails\{version}\projects\{project}\plugins

In case your classes are referring to any classes / interfaces that are defined in the plugin you can add the code under the above path as a source path.

I did the following for Taggable plugin -
Added a variable GRAILS_PLUGIN_DIR & pointed it to user.home\.grails\projects\plugins
Added a source path by using "Link Source" option, extended the above variable GRAILS_PLUGIN_DIR\taggable-{version}\src\groovy

With this change eclipse is able to find the Taggable interface and stop's complaining about missing imports.