List of usage examples for org.hibernate SQLQuery setParameter
@Override NativeQuery<T> setParameter(int position, Object val);
From source file:ispyb.server.common.services.ws.rest.session.SessionServiceBean.java
License:Open Source License
@Override public List<Map<String, Object>> getSessionViewByDates(String startDate, String endDate) { Session session = (Session) this.entityManager.getDelegate(); SQLQuery query = session.createSQLQuery(ByDates); query.setParameter("startDate", startDate); query.setParameter("endDate", endDate); return executeSQLQuery(query); }
From source file:ispyb.server.common.services.ws.rest.session.SessionServiceBean.java
License:Open Source License
@Override public List<Map<String, Object>> getSessionViewByProposalAndDates(int proposalId, String startDate, String endDate) {/* w w w . j a v a2s . c om*/ Session session = (Session) this.entityManager.getDelegate(); SQLQuery query = session.createSQLQuery(ByProposalAndDates); query.setParameter("startDate", startDate); query.setParameter("endDate", endDate); query.setParameter("proposalId", proposalId); System.out.println(query.getQueryString()); return executeSQLQuery(query); }
From source file:ispyb.server.common.services.ws.rest.session.SessionServiceBean.java
License:Open Source License
@Override public List<Map<String, Object>> getSessionViewByBeamlineOperator(String beamlineOperator) { Session session = (Session) this.entityManager.getDelegate(); SQLQuery query = session.createSQLQuery(ByBeamlineOperator); query.setParameter("beamlineOperator", "%" + beamlineOperator + "%"); System.out.println(query.getQueryString()); return executeSQLQuery(query); }
From source file:ispyb.server.common.services.ws.rest.session.SessionServiceBean.java
License:Open Source License
@Override public List<Map<String, Object>> getSessionViewByDates(String startDate, String endDate, String siteId) { Session session = (Session) this.entityManager.getDelegate(); SQLQuery query = session.createSQLQuery(ByDatesAndSiteId); query.setParameter("startDate", startDate); query.setParameter("endDate", endDate); query.setParameter("siteId", siteId); return executeSQLQuery(query); }
From source file:ispyb.server.common.services.ws.rest.shipment.ShipmentRestWsServiceBean.java
License:Open Source License
@Override public List<Map<String, Object>> getShipmentHistoryByShipmentId(int proposalId, int shipmentId) { String mySQLQuery = getHistoryQuery + " where Shipping_shippingId = :shippingId and Shipping_proposalId = :proposalId"; Session session = (Session) this.entityManager.getDelegate(); SQLQuery query = session.createSQLQuery(mySQLQuery); query.setParameter("proposalId", proposalId); query.setParameter("shippingId", shipmentId); return executeSQLQuery(query); }
From source file:ispyb.server.em.services.collections.EM3ServiceBean.java
License:Open Source License
@Override public List<Map<String, Object>> getMoviesDataByDataCollectionId(int proposalId, int dataCollectionId) { Session session = (Session) this.entityManager.getDelegate(); SQLQuery query = session.createSQLQuery(ByDataCollectionId); query.setParameter("dataCollectionId", dataCollectionId); query.setParameter("proposalId", proposalId); return executeSQLQuery(query); }
From source file:ispyb.server.em.services.collections.EM3ServiceBean.java
License:Open Source License
@Override public List<Map<String, Object>> getStatsBySessionId(int proposalId, int sessionId) { Session session = (Session) this.entityManager.getDelegate(); SQLQuery query = session.createSQLQuery(getStatsBySessionId); System.out.println(getStatsBySessionId); query.setParameter("sessionId", sessionId); query.setParameter("proposalId", proposalId); return executeSQLQuery(query); }
From source file:ispyb.server.mx.services.sample.Protein3ServiceBean.java
License:Open Source License
@Override public List<Map<String, Object>> getStatsByProposal(int proposalId) { String mySQLQuery = getViewTableQuery() + " where proposalId = :proposalId"; Session session = (Session) this.entityManager.getDelegate(); SQLQuery query = session.createSQLQuery(mySQLQuery); query.setParameter("proposalId", proposalId); query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE); return executeSQLQuery(query); }
From source file:ispyb.server.mx.services.ws.rest.autoprocessingintegration.AutoProcessingIntegrationServiceBean.java
License:Open Source License
@Override public List<Map<String, Object>> getViewByDataCollectionId(int proposalId, int dataCollectionId) { Session session = (Session) this.entityManager.getDelegate(); SQLQuery query = session.createSQLQuery(ByDataCollectionId); query.setParameter("dataCollectionId", dataCollectionId); query.setParameter("proposalId", proposalId); System.out.println(query.toString()); return executeSQLQuery(query); }
From source file:ispyb.server.mx.services.ws.rest.datacollection.DataCollectionRestWsServiceBean.java
License:Open Source License
@Override public Collection<? extends Map<String, Object>> getViewDataCollectionsByWorkflowId(int proposalId, Integer workflowId) {//from www .j a v a2 s . com String mySQLQuery = this.getViewTableQuery() + " where proposalId = :proposalId and workflowId = :workflowId group by v_datacollection.dataCollectionId"; Session session = (Session) this.entityManager.getDelegate(); SQLQuery query = session.createSQLQuery(mySQLQuery); query.setParameter("proposalId", proposalId); query.setParameter("workflowId", workflowId); return executeSQLQuery(query); }