TO THE NEW Blog PAGES

Grails

Criteria Query with Left Outer Join

In Grails app development, when using criteria queries, we often find cases for Outer joins. Lets take an example. We have two domain classes with us: [java] class Blog { String title String content static hasMany = [comments: Comment] static constraints = { } } [/java] and [java] class Comment { String text static belongsTo […]

Himanshu Seth
Himanshu Seth
Read

Grails

Grails bindData to collections

Recently, I was stuck with a scenario where I was trying to bind a list of objects in my controller. While trying the way as suggested in the grails docs I was getting some weird IndexOutOfBoundException. Luckily I found a good solution on the grails mailing list: http://grails.1312388.n4.nabble.com/Databinding-Collection-of-non-domain-objects-tp3260578p3260856.html Thanks to mkwhit for asking this and […]

Mohd Farid
Mohd Farid
Read

Grails

Creating a Perfect System in few minutes.

There might come up a case where you need to install same kind of OS and other Softwares( which are required for daily use) on multiple systems. One of the ways to do it is follow the same procedure on each of the machines, which is obviously a pain. Here’s a easy way to do […]

Hitesh Bhatia
Hitesh Bhatia
Read

Grails

Create Image of System in USB, Using Clonezilla

Clonezilla is a software that can be used to make image of system that can later be used to install this image on new system, to make it a clone of former system. Here are the steps to create image of a system by clonezilla Create a Bootable USB drive Using Clonezilla. Follow the link […]

Hitesh Bhatia
Hitesh Bhatia
Read

Technology

Installing CloneZilla on USB drive using Ubuntu.

Clonezilla is a software that allows you to do bare metal backup and recovery. To install Clonezilla we would need following Softwares, all of which are available freely. 7zip ( p7zip-full_9.04~dfsg.1-1_i386.deb) Tuxboot (tuxboot-linux-8 ) Clonezilla (clonezilla-live-1.2.6-40-i686.iso) Here are the steps to install CloneZilla Install 7zip required to install Tuxboot sudo dpkg -i p7zip-full_9.04~dfsg.1-1_i386.deb It would […]

Hitesh Bhatia
Hitesh Bhatia
Read

Grails

Log Sql in grails for a piece of code

There are time when we need to see the sql logging statement just for a method of for a particular code. Although we already have logSql property in DataSource to do it for us but it sometimes makes difficult if we need to see the log for a small piece of code rather than for […]

Grails

Mysql top just like we have top command in Linux

Once in my grails project i was facing the problem of freeze of server.When this happens tomcat becomes unresponsive.Later on by analyzing the thread dump we found that this problem might be due to the database and tomcat communication. So as to analyse how many connection are active at mysql end we found a query. Show processlist; […]

Anuj Aneja
Anuj Aneja
Read

Technology

Making your own custom command for a script file which can be executed from any user.

One way to execute the script file via command can be making of alias and put it in .bashrc , but this will only be available to that user. So for creating a user-defined command which can be executed from any where for any user following steps need to be followed: 1. Make a script […]

Anuj Aneja
Anuj Aneja
Read

Grails

Closure as an implementation to interface

Recently, I saw some code of grails Hibernate Plugin and noticed an interesting usage of ‘as’ operator. The ‘as’ operator of groovy is typically used to change the types of objects. For example: [groovy] int a = "20" as int assert a==20 [/groovy] The ‘as’ operator can be used to provide implementation to interface as […]

Mohd Farid
Mohd Farid
Read

Grails

How to get Google Indexed Pages Count, and/or do Google searches through AJAX/programmatically

Hi, Recently i had to get the count of the Pages Google has Indexed for a perticular web Site progmatically. In the process i found that Google offers an AJAX Search API to perform Google Searches. . Hence i Implemented a Class which does the same for me easily(Ajax Search in Google). And this Solution […]

Kushal Likhi
Kushal Likhi
Read

Grails

Annotation for checking required session fields

Recently I worked on a project where I used spring security plugin. Its a very wonderful plugin for making your application secured from unauthorized users. It gives you a simple annotation @Secured to add security to your action and controller. Thats the first time I got to know the real use case of annotation. So […]

Grails

Fast DB Management Through IDEA- Increase Productivity

Hi, well we can run SQL Queries and browse database through IDEA with a good GUI interface. It Just Requires Two Steps: 1) Setup (One time) 2)Usage (how to) A: Setup PART I 1) Download the Database Navigator Tool From Intellij Repo -> Download Tool 2) Then Execute in the Directory containing the downloaded file […]

Kushal Likhi
Kushal Likhi
Read