Package org.hibernate

Examples of org.hibernate.SQLQuery.addScalar()


        query.addScalar("SIZE");
        query.addScalar("available");
        query.addScalar("used");
        query.addScalar("elementname");
        query.addScalar("STATE");
        query.addScalar("tier");
        Map<String, Object> params = new HashMap<String, Object>();
        params.put("id_vdc", vdc.getId());
        params.put("state", VolumeState.DETACHED.name());
        params.put("storage_tecnology", "GENERIC_ISCSI");
        query.setProperties(params);
View Full Code Here


     */
    @Override
    public List findByNativeQuery(String nativeQuery, Map params, Class entity, ResultTransformer rt, ScalarReturn scalar) {
        SQLQuery query = getSession().createSQLQuery(nativeQuery);
        if (scalar != null) {
            query.addScalar(scalar.getColumnAlias(), scalar.getType());
        }
        if (rt != null) {
            query.setResultTransformer(rt);
        }
        if (entity != null) {
View Full Code Here

    if (fin != null) {
      q.setParameter("FECHA_FIN", fin, Hibernate.TIMESTAMP);
    }

    q.addScalar("nombreRecurso", Hibernate.STRING);

    log.debug(sb.toString() + " => " + inicio + " " + fin);

    List<String> result = q.list();
View Full Code Here

    sb.append("order by nombreRecurso");

    SQLQuery q = getSession().createSQLQuery(sb.toString());

    q.addScalar("nombreRecurso", Hibernate.STRING);
    q.setString("USUARIO", u.getNombreUsuario());
    if (log.isDebugEnabled()) {
      log.debug(sb.toString());
    }
View Full Code Here

                        && !rel.getProperty().isAnnotationPresent(OneToMany.class)
                        && (rel.getProperty().isAnnotationPresent(OneToOne.class)
                                && StringUtils.isBlank(rel.getMappedBy()) || rel.getProperty().isAnnotationPresent(
                                ManyToOne.class)))
                {
                    q.addScalar(name != null ? name : r);
                }
            }
        }
        return q;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.