A list/map can be passed as a parameterClass to an iBATIS sql map to iterate. A IN clause is the basic example of iteration over a list and create comma separated query. For example, if a list have 3 elements (10,20,30). It is passed as parameterClass in the query for a IN clause, the syntax is like following:

You can define a list in the parameterClass. But what about a array? You cannot define array like int[] in the parameter class. Most surprising thing is, for an array you do not have to define a parameterClass in iBATIS. If nothing is defined as parameterClass then it is considered as Array.

If you want to iterate over an array with then the following code works fine. Every array elements will be printed in the code #[]#.

Android 4 (API level-14) has changed it’s userdata.img file location. On other versions (upto andoid 3.2, api level 13), it was kept in location -/android-sdk-linux/platforms/android-(api level)/images/userdata.img. Intellij IDEA (up to 10.5.2) is not up to date with this current change. Therefore shows “Unable to find a ‘userdata.img’ file to copy into the AVD folder” when you will try to create a new “Android Virtual Device”.

Even the idea site is misleading to the solution of this problem. They ask to follow a solution from stack overflow site. But that is not a solution too.

Solution:From idea’s Run/Debug configuration click on browse besides “Prefer Android Virtual Device for deployment”. Then from “Select Android Virtual Device” screen click on Android SDK Manage Then from Android SDK Manager, click on Tools and choose Manage AVDs. Then from Android Virtual Device Manage Click New and create the AVD for version 4.

If anyone like to compare a Enum value with JSP if tag there is a little surprise for him. JSP if tag do not support to compare a enum value directly in the test condition. For example a java Enum Employee.

public enum Employee {
PART_TIME,
FULL_TIME;
}

Now if you want to compare the Enum value in jsp if tag directly like following,
<c:if test="${bean.employee == '<%=Employee.PART_TIME%>'}">
.........
</c:if>

JSP generates error. But if you assign the value to a variable and compare then this is allowed as following

Reference: Definite Guide to Grails, 2nd Edition

At runtime in java, actual method invocation depends on type of the object to which it refers not on the type of the target object. While groovy depends on the type of the target object. For example in the following java code, where DecimalNumber class extends FullNumber.
public class TestNumber {

GSP tag g:sortableColumn is used for sorting list in Grails. A list by default shows all the rows stored in database. A user can sort the list ascending/descending order by clicking on that column header.

But the same thing do not works for a customized search result (Criteria Search). For example a search result fetch 6 of 10 rows from database. If you display the result by tag, clicking on the column header for sorting will display all the 10 sorted rows in place of 6. This is happened because search parameters are missing in result page. Lets see the example below: Suppose we have a Book Class, Saerch Cmd and a criteria search for this class

Now if the id parameter is 6 and there is 10 id 1..10 it will display 6 rows but when you try to sort the result using <g:sortableColumn> in result.gsp page it will display all 10 result as there is no params in the result page. In the code crit.list(params) works when it gets search paramter, otherwise it execute default list() method.

A easy way out of the problem is saving searchCmd in the session and re-use for sorting the customized search result while the request comes from result page (params.search indicates request from search page). Some minor modification of the above code can do it as following code: