query.append("layoutId = ?");
query.append(" AND ");
query.append("userId = ?");
query.append(" ");
Query q = session.createQuery(query.toString());
int queryPos = 0;
q.setString(queryPos++, layoutId);
q.setString(queryPos++, userId);
Iterator itr = q.list().iterator();