Session session = jpaEntityManager.getActiveSession(); List args = new ArrayList(); args.add(“ae01403”); args.add(“app_code”); args.add(“it_IT”); List results = (List) session.executeQuery(query, args);
StoredProcedureCall storedProcedureCall = new StoredProcedureCall(); storedProcedureCall.setProcedureName("mypackage.myprocedure"); storedProcedureCall.addNamedArgument("i_input_1"); // Add input argument name. storedProcedureCall.addNamedOutputArgument("o_output_1"); // Add output parameter name. DataReadQuery query = new DataReadQuery(); query.setCall(storedProcedureCall); query.addArgument("i_input_1"); // Add input argument names (again); List<Object> argumentValues = new ArrayList<Object>(); argumentValues.add("valueOf_i_input_1"); // Add input argument values. JpaEntityManager jpaEntityManager = (JpaEntityManager) getEntityManager(); Session session = jpaEntityManager.getActiveSession(); List<?> results = (List<?>) session.executeQuery(query, argumentValues); DatabaseRecord record = (DatabaseRecord) results.get(0); String result = String.valueOf(record.get("o_output_1")); // Get output parameter
/** * PUBLIC: * If the PKs were retrieved with the attributes then this method can be used to read the real object from the database. */ public Object readObject(Class javaClass, Session session) { if (getId() == null) { throw QueryException.reportQueryResultWithoutPKs(this); } ReadObjectQuery query = new ReadObjectQuery(javaClass); query.setSelectionId(getId()); return session.executeQuery(query); }
/** * PUBLIC: * If the PKs were retrieved with the attributes then this method can be used to read the real object from the database. */ public Object readObject(Class javaClass, Session session) { if (getId() == null) { throw QueryException.reportQueryResultWithoutPKs(this); } ReadObjectQuery query = new ReadObjectQuery(javaClass); query.setSelectionId(getId()); return session.executeQuery(query); }
/** * PUBLIC: * If the PKs were retrieved with the attributes then this method can be used to read the real object from the database. */ public Object readObject(Class javaClass, Session session) { if (getPrimaryKeyValues() == null) { throw QueryException.reportQueryResultWithoutPKs(this); } ReadObjectQuery query = new ReadObjectQuery(javaClass); query.setSelectionKey(getPrimaryKeyValues()); return session.executeQuery(query); }
performPreQueryFlush(); Integer changedRows = (Integer) getActiveSession().executeQuery(databaseQuery, parameterValues); return changedRows.intValue(); } catch (PersistenceException exception) {
Object value = xrService.getORSession().getActiveSession().executeQuery(query);
Object value = xrService.getORSession().getActiveSession().executeQuery(query, argVals);
Boolean prevSoftDeletion = CubaUtil.setSoftDeletion(false); try { result = session.executeQuery(query); } finally { CubaUtil.setSoftDeletion(prevSoftDeletion); result = session.executeQuery(query);
entity._persistence_setSession(null); Object result = session.executeQuery(query); if (result == null) {
return session.executeQuery(query, parameterValues); } catch (DatabaseException e) { throw getDetailedException(e);