1

Executing the following restrictions runs into following error

 Message: java.lang.String cannot be cast to java.lang.Integer

       if (suburbid > 0) {
            criteria.add(Restrictions.ilike("suburb.id", suburbid));
        } 

2 Answers2

0

Change

criteria.add(Restrictions.ilike("address.subrub.id", suburbid));

to

criteria.add(Restrictions.ilike("suburb.id", suburbid));

UPDATE

Also try to change

.createAlias("development.address.suburb", "suburb");

to

.createAlias("devAddress.suburb", "suburb");
Alex
  • 11,451
  • 6
  • 37
  • 52
  • it is not id of address. It is id of suburb which is in the address class –  Jun 18 '13 at 06:51
0

You cant use iLike for integer change it to eq.

J888
  • 1,944
  • 8
  • 42
  • 76