Example usage for org.hibernate SQLQuery setParameter

List of usage examples for org.hibernate SQLQuery setParameter

Introduction

In this page you can find the example usage for org.hibernate SQLQuery setParameter.

Prototype

@Override
    NativeQuery<T> setParameter(int position, Object val);

Source Link

Usage

From source file:ispyb.server.mx.services.ws.rest.phasing.PhasingRestWsServiceBean.java

License:Open Source License

@Override
public List<Map<String, Object>> getPhasingViewByDataCollectionId(int dataCollectionId, int proposalId) {
    Session session = (Session) this.entityManager.getDelegate();
    SQLQuery query = session.createSQLQuery(ByDataCollectionId);
    query.setParameter("dataCollectionId", dataCollectionId);
    query.setParameter("proposalId", proposalId);
    System.out.println(query.getQueryString());
    return executeSQLQuery(query);
}