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.biosaxs.services.core.analysis.abInitioModelling.AbInitioModelling3ServiceBean.java

License:Open Source License

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

From source file:ispyb.server.biosaxs.services.core.analysis.Analysis3ServiceBean.java

License:Open Source License

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

From source file:ispyb.server.biosaxs.services.core.analysis.Analysis3ServiceBean.java

License:Open Source License

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

From source file:ispyb.server.biosaxs.services.core.analysis.Analysis3ServiceBean.java

License:Open Source License

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

From source file:ispyb.server.biosaxs.services.core.analysis.Analysis3ServiceBean.java

License:Open Source License

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

From source file:ispyb.server.biosaxs.services.core.analysis.Analysis3ServiceBean.java

License:Open Source License

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

From source file:ispyb.server.biosaxs.services.core.analysis.Analysis3ServiceBean.java

License:Open Source License

@Override
public List<Map<String, Object>> getCompactAnalysisByProposalId(Integer proposalId, Integer limit) {
    StringBuilder mySQLQuery = new StringBuilder(SQLQueryKeeper.getAnalysisCompactQueryByProposalId(limit));
    Session session = (Session) this.entityManager.getDelegate();
    SQLQuery query = session.createSQLQuery(mySQLQuery.toString());
    query.setParameter("proposalId", proposalId);
    query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE);
    @SuppressWarnings("unchecked")
    List<Map<String, Object>> aliasToValueMapList = query.list();
    return aliasToValueMapList;
}

From source file:ispyb.server.biosaxs.services.core.analysis.Analysis3ServiceBean.java

License:Open Source License

@Override
public List<Map<String, Object>> getCompactAnalysisByProposalId(Integer proposalId, Integer start,
        Integer limit) {/*w w  w.  j a va2  s  .c o m*/
    StringBuilder mySQLQuery = new StringBuilder(
            SQLQueryKeeper.getAnalysisCompactQueryByProposalId(start, limit));
    Session session = (Session) this.entityManager.getDelegate();
    SQLQuery query = session.createSQLQuery(mySQLQuery.toString());
    query.setParameter("proposalId", proposalId);
    query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE);
    @SuppressWarnings("unchecked")
    List<Map<String, Object>> aliasToValueMapList = query.list();
    return aliasToValueMapList;
}

From source file:ispyb.server.biosaxs.services.core.analysis.Analysis3ServiceBean.java

License:Open Source License

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

From source file:ispyb.server.biosaxs.services.core.analysis.Analysis3ServiceBean.java

License:Open Source License

@Override
public List<Map<String, Object>> getCompactAnalysisByMacromoleculeId(Integer proposalId,
        Integer macromoleculeId) {
    StringBuilder mySQLQuery = new StringBuilder(SQLQueryKeeper.getAnalysisCompactQueryByMacromoleculeId());
    System.out.println(mySQLQuery.toString());
    Session session = (Session) this.entityManager.getDelegate();
    SQLQuery query = session.createSQLQuery(mySQLQuery.toString());
    query.setParameter("proposalId", proposalId);
    query.setParameter("macromoleculeId", macromoleculeId);

    query.setResultTransformer(AliasToEntityMapResultTransformer.INSTANCE);
    @SuppressWarnings("unchecked")
    List<Map<String, Object>> aliasToValueMapList = query.list();
    return aliasToValueMapList;
}