Example usage for org.hibernate.transform AliasToEntityMapResultTransformer INSTANCE

List of usage examples for org.hibernate.transform AliasToEntityMapResultTransformer INSTANCE

Introduction

In this page you can find the example usage for org.hibernate.transform AliasToEntityMapResultTransformer INSTANCE.

Prototype

AliasToEntityMapResultTransformer INSTANCE

To view the source code for org.hibernate.transform AliasToEntityMapResultTransformer INSTANCE.

Click Source Link

Usage

From source file:ispyb.server.common.daos.shipping.Shipping3DAOBean.java

License:Open Source License

@Override
public List<Map<String, Object>> getShippingById(int shippingId) {
    String mySQLQuery = this.FIND_BY_SHIPPING_ID();
    Session session = (Session) this.entityManager.getDelegate();
    SQLQuery query = session.createSQLQuery(mySQLQuery);
    query.setParameter("shippingId", shippingId);
    query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE);
    List<Map<String, Object>> aliasToValueMapList = query.list();
    return aliasToValueMapList;
}

From source file:ispyb.server.common.daos.shipping.Shipping3DAOBean.java

License:Open Source License

@Override
public List<Map<String, Object>> getShippingByProposalId(int proposalId) {
    String mySQLQuery = this.FIND_BY_PROPOSAL_ID();
    Session session = (Session) this.entityManager.getDelegate();
    SQLQuery query = session.createSQLQuery(mySQLQuery);
    query.setParameter("proposalId", proposalId);
    query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE);
    List<Map<String, Object>> aliasToValueMapList = query.list();
    return aliasToValueMapList;
}

From source file:ispyb.server.common.services.proposals.Proposal3ServiceBean.java

License:Open Source License

@Override
public List<Map<String, Object>> findProposals() {
    Session session = (Session) this.entityManager.getDelegate();
    SQLQuery query = session.createSQLQuery("select " + SqlTableMapper.getProposalTable() + " from Proposal");
    query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE);
    @SuppressWarnings("unchecked")
    List<Map<String, Object>> aliasToValueMapList = query.list();
    return aliasToValueMapList;
}

From source file:ispyb.server.common.services.proposals.Proposal3ServiceBean.java

License:Open Source License

private List findProposalByProposalId(Integer proposalId) {
    Session session = (Session) this.entityManager.getDelegate();
    SQLQuery query = session.createSQLQuery(
            "select " + SqlTableMapper.getProposalTable() + " from Proposal where proposalId= :proposalId");
    query.setParameter("proposalId", proposalId);
    query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE);
    return query.list();
}

From source file:ispyb.server.common.services.shipping.external.External3ServiceBean.java

License:Open Source License

@Override
public List<Map<String, Object>> getDataCollectionByProposal(String proposalCode, String proposalNumber) {
    String mySQLQuery = SQLQueryKeeper.getDataCollectionByProposal();
    Session session = (Session) this.entityManager.getDelegate();
    SQLQuery query = session.createSQLQuery(mySQLQuery);
    query.setParameter("proposalCode", proposalCode);
    query.setParameter("proposalNumber", proposalNumber);
    query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE);
    @SuppressWarnings("unchecked")
    List<Map<String, Object>> aliasToValueMapList = query.list();
    return aliasToValueMapList;
}

From source file:ispyb.server.common.services.shipping.external.External3ServiceBean.java

License:Open Source License

/**
 * Return session by proposal code and number
 * @param code MX, opd, SAXS//from   w  w  w . j  a  va 2  s . co  m
 * @param number 
 * @return
 */
@Override
public List<Map<String, Object>> getSessionsByProposalCodeAndNumber(String proposalCode,
        String proposalNumber) {
    String mySQLQuery = SQLQueryKeeper.getSessionByCodeAndNumber();
    Session session = (Session) this.entityManager.getDelegate();
    SQLQuery query = session.createSQLQuery(mySQLQuery);
    query.setParameter("proposalCode", proposalCode);
    query.setParameter("proposalNumber", proposalNumber);
    query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE);
    return executeSQLQuery(query);

}

From source file:ispyb.server.common.services.shipping.external.External3ServiceBean.java

License:Open Source License

@Override
public List<Map<String, Object>> getDataCollectionFromShippingId(int shippingId) {
    String mySQLQuery = this.getDataCollectionFromShippingId();
    Session session = (Session) this.entityManager.getDelegate();
    SQLQuery query = session.createSQLQuery(mySQLQuery);
    query.setParameter("shippingId", shippingId);
    query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE);
    return executeSQLQuery(query);

}

From source file:ispyb.server.common.services.shipping.external.External3ServiceBean.java

License:Open Source License

@Override
public List<Map<String, Object>> getAllDataCollectionFromShippingId(int shippingId) {
    String mySQLQuery = this.getAllDataCollectionFromShippingId();
    Session session = (Session) this.entityManager.getDelegate();
    SQLQuery query = session.createSQLQuery(mySQLQuery);
    query.setParameter("shippingId", shippingId);
    query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE);
    return executeSQLQuery(query);

}

From source file:ispyb.server.common.services.shipping.external.External3ServiceBean.java

License:Open Source License

@Override
public List<Map<String, Object>> getAutoprocResultByDataCollectionIdList(
        ArrayList<Integer> dataCollectionIdList) {

    String mySQLQuery = this.getAutoprocResultByDataCollectionIdListQuery();
    Session session = (Session) this.entityManager.getDelegate();
    SQLQuery query = session.createSQLQuery(mySQLQuery);
    query.setParameterList("dataCollectionIdList", dataCollectionIdList);
    query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE);
    return executeSQLQuery(query);
}

From source file:ispyb.server.common.services.shipping.external.External3ServiceBean.java

License:Open Source License

@Override
public List<Map<String, Object>> getPhasingAnalysisByDataCollectionIdListQuery(Integer autoProcIntegrationId) {

    String mySQLQuery = this.getPhasingAnalysisByDataCollectionIdListQuery();
    Session session = (Session) this.entityManager.getDelegate();
    SQLQuery query = session.createSQLQuery(mySQLQuery);
    query.setParameter("autoProcIntegrationId", autoProcIntegrationId);
    query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE);
    return executeSQLQuery(query);
}