Question: I am using sms gateway. I want sent the data like the following format through url

```
http://127.0.0.1:13013/cgi-bin/sendsms?username=uname&password=password&to=+911111111111&text=Hello

```

i want to call this url but the present page could not be change, because that page working another function at the same time. Am using header function, it sent sms but the current page function can't work. So any one suggest me a solution

Answer: 
According [to this](https://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/jpql), you can use the KEY() and VALUE(), and in your case, it would give something like this:

```
Query query = em.createQuery("SELECT obj from x obj where x.no=KEY(:mapParam) and x.amount=VALUE(:mapParam)");
query.setParamters("mapParam", yourMap);
query.getResultList();

```

Be careful though, you need to be on JPA 2.0, and there was some problems with Hibernate, that was fixed since the time, but still, you have to be on a fixed version (4.1.4+). See [this](https://hibernate.atlassian.net/browse/HHH-5396).
With this loop you can iterate through the `Map` to execute `select statements` for all the key-value pairs:

```
Query query = em.createQuery("SELECT obj from x obj where x.no=:x_no and x.amount=:x_amt");
List<ResultObj> resultList = new ArrayList<ResultObj>();
Iterator<Entry<String, Value>> iter = yourMap.entrySet().iterator();
while (iter.hasNext()) {
    Entry<String, Value> next = iter.next();
    Value value = next.getValue();
    query.setParameter("x_no", next).setParameter("x_amt", value);
    ResultObj result = (ResultObj) query.getSingleResult();
    resultList.add(result);
}

```