I have a query string line by line:
session.createSQLQuery("SELECT C.FIRSTNAME AS firstName, C.LASTNAME as lastName FROM ADDRESSBOOK_CONTACT AS C WHERE C.ADDRESSBOOK_ID = :addressbookId AND firstName = ?");
When setting up my positional parameter, the query is executed as usual, but there is no result:
query.setParameter(0, "firstname1010"); query.setParameter("addressbookId", addressbook.getId());
It is not right. If I changed my positional to named:
query.setParameter(firstname, "firstname1010");
Then my query returns the correct results.
Without going into an intricate explanation of why I am doing this, I would like to know whether mixing of the two types should be supported or not? I am using hibernate 3.6.3. Final
mogronalol
source share