Package org.hibernate.criterion

Examples of org.hibernate.criterion.Criterion


    Session tmpSession = null;
    Transaction tx = null;
    try {
      tmpSession = getSession();
      tx = tmpSession.beginTransaction();
      Criterion labelCriterrion = Expression.eq("label", label);
      Criteria criteria = tmpSession.createCriteria(SbiDataSource.class);
      criteria.add(labelCriterrion)
      SbiDataSource hibDS = (SbiDataSource) criteria.uniqueResult();
      if (hibDS == null) return null;
      biDS = toDataSource(hibDS);       
View Full Code Here


    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
     
      Criterion aCriterion = Expression.eq("valueId",  aDataSource.getDialectId());
      Criteria criteria = aSession.createCriteria(SbiDomains.class);
      criteria.add(aCriterion);

      SbiDomains dialect = (SbiDomains) criteria.uniqueResult();
View Full Code Here

    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
     
      Criterion aCriterion = Expression.eq("valueId",  aDataSource.getDialectId());
      Criteria criteria = aSession.createCriteria(SbiDomains.class);
      criteria.add(aCriterion);

      SbiDomains dialect = (SbiDomains) criteria.uniqueResult();
View Full Code Here

    Transaction tx = null;
    List toReturn = new ArrayList();
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      Criterion userIdCriterion = Expression.eq("userName", userId);
      Criteria criteria = aSession.createCriteria(SbiRememberMe.class);
      criteria.add(userIdCriterion);
      //criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
      List list = criteria.list();
      Iterator it = list.iterator();
View Full Code Here

    Transaction tx = null;
    RememberMe toReturn = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      Criterion userIdCriterion = Expression.eq("id", rememberMeId);
      Criteria criteria = aSession.createCriteria(SbiRememberMe.class);
      criteria.add(userIdCriterion);
      //criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
      List list = criteria.list();
      Iterator it = list.iterator();
View Full Code Here

            ((SbiQueryDataSet)hibDataSet).setQuery(((QueryDataSetDetail)dataSetActiveDetail).getQuery().toString());
          }
          if(((QueryDataSetDetail)dataSetActiveDetail).getDataSourceLabel()!=null){
            SbiDataSource hibDataSource = null;
            String dataSourceLabel = ((QueryDataSetDetail)dataSetActiveDetail).getDataSourceLabel();
            Criterion labelCriterrion = Expression.eq("label", dataSourceLabel);
            Criteria criteria = aSession.createCriteria(SbiDataSource.class);
            criteria.add(labelCriterrion)
            hibDataSource = (SbiDataSource) criteria.uniqueResult();
            ((SbiQueryDataSet)hibDataSet).setDataSource(hibDataSource)
          }       
        } 
       
        else if(dataSetActiveDetail instanceof QbeDataSetDetail){
          hibDataSet = new SbiQbeDataSet();
          SbiQbeDataSet hibQbeDataSet = (SbiQbeDataSet) hibDataSet;
          QbeDataSetDetail qbeDataSet = (QbeDataSetDetail) dataSetActiveDetail;
          hibQbeDataSet.setSqlQuery(qbeDataSet.getSqlQuery());
          hibQbeDataSet.setJsonQuery(qbeDataSet.getJsonQuery());
          hibQbeDataSet.setDatamarts(qbeDataSet.getDatamarts());
          String dataSourceLabel = qbeDataSet.getDataSourceLabel();
          Criterion labelCriterrion = Expression.eq("label", dataSourceLabel);
          Criteria criteria = aSession.createCriteria(SbiDataSource.class);
          criteria.add(labelCriterrion)
          SbiDataSource hibDataSource = (SbiDataSource) criteria.uniqueResult();
          hibQbeDataSet.setDataSource(hibDataSource)
        }

        else if(dataSetActiveDetail instanceof WSDataSetDetail){
          hibDataSet=new SbiWSDataSet();
          if(((WSDataSetDetail)dataSetActiveDetail).getAddress()!=null){
            ((SbiWSDataSet)hibDataSet).setAdress(((WSDataSetDetail)dataSetActiveDetail).getAddress());
          }
          if(((WSDataSetDetail)dataSetActiveDetail).getOperation()!=null){
            ((SbiWSDataSet)hibDataSet).setOperation(((WSDataSetDetail)dataSetActiveDetail).getOperation());
         
        }

        else if(dataSetActiveDetail instanceof JClassDataSetDetail){
          hibDataSet=new SbiJClassDataSet();
          if(((JClassDataSetDetail)dataSetActiveDetail).getJavaClassName()!=null){
            ((SbiJClassDataSet)hibDataSet).setJavaClassName(((JClassDataSetDetail)dataSetActiveDetail).getJavaClassName());
          }
        }

        else if(dataSetActiveDetail instanceof ScriptDataSetDetail){
          hibDataSet=new SbiScriptDataSet();
          if(((ScriptDataSetDetail)dataSetActiveDetail).getScript()!=null){
            ((SbiScriptDataSet)hibDataSet).setScript(((ScriptDataSetDetail)dataSetActiveDetail).getScript());
          }
          if(((ScriptDataSetDetail)dataSetActiveDetail).getLanguageScript()!=null){
            ((SbiScriptDataSet)hibDataSet).setLanguageScript(((ScriptDataSetDetail)dataSetActiveDetail).getLanguageScript());
          }
        }

        SbiDomains transformer = null;
        if (dataSetActiveDetail.getTransformerId() != null){
          Criterion aCriterion = Expression.eq("valueId",  dataSetActiveDetail.getTransformerId());
          Criteria criteria = aSession.createCriteria(SbiDomains.class);
          criteria.add(aCriterion);

          transformer = (SbiDomains) criteria.uniqueResult();

          if (transformer == null){
            logger.error("The Domain with value_id= "+dataSetActiveDetail.getTransformerId()+" does not exist.");
            throw new EMFUserError(EMFErrorSeverity.ERROR, 1035);
          }
        }

        SbiDomains category = null;
        if (dataSetActiveDetail.getCategoryId()!= null){
          Criterion aCriterion = Expression.eq("valueId",  dataSetActiveDetail.getCategoryId());
          Criteria criteria = aSession.createCriteria(SbiDomains.class);
          criteria.add(aCriterion);

          category = (SbiDomains) criteria.uniqueResult();
View Full Code Here

            ((SbiQueryDataSet)hibDataSet).setQuery(((QueryDataSetDetail)dsActiveDetailToSet).getQuery().toString());
          }
          if(((QueryDataSetDetail)dsActiveDetailToSet).getDataSourceLabel()!=null){
            SbiDataSource hibDataSource = null;
            String dataSourceLabel = ((QueryDataSetDetail)dsActiveDetailToSet).getDataSourceLabel();
            Criterion labelCriterrion = Expression.eq("label", dataSourceLabel);
            Criteria criteria = aSession.createCriteria(SbiDataSource.class);
            criteria.add(labelCriterrion)
            hibDataSource = (SbiDataSource) criteria.uniqueResult();
            ((SbiQueryDataSet)hibDataSet).setDataSource(hibDataSource)
          }       
        }
       
        else if (dsActiveDetailToSet instanceof QbeDataSetDetail) {
          hibDataSet = new SbiQbeDataSet();
          SbiQbeDataSet hibQbeDataSet = (SbiQbeDataSet) hibDataSet;
          QbeDataSetDetail qbeDataSet = (QbeDataSetDetail) dsActiveDetailToSet;
          hibQbeDataSet.setSqlQuery(qbeDataSet.getSqlQuery());
          hibQbeDataSet.setJsonQuery(qbeDataSet.getJsonQuery());
          hibQbeDataSet.setDatamarts(qbeDataSet.getDatamarts());
          String dataSourceLabel = qbeDataSet.getDataSourceLabel();
          Criterion labelCriterrion = Expression.eq("label", dataSourceLabel);
          Criteria criteria = aSession.createCriteria(SbiDataSource.class);
          criteria.add(labelCriterrion)
          SbiDataSource hibDataSource = (SbiDataSource) criteria.uniqueResult();
          hibQbeDataSet.setDataSource(hibDataSource)
        }

        else if(dsActiveDetailToSet instanceof WSDataSetDetail){
          hibDataSet=new SbiWSDataSet();
          if(((WSDataSetDetail)dsActiveDetailToSet).getAddress()!=null){
            ((SbiWSDataSet)hibDataSet).setAdress(((WSDataSetDetail)dsActiveDetailToSet).getAddress());
          }
          if(((WSDataSetDetail)dsActiveDetailToSet).getOperation()!=null){
            ((SbiWSDataSet)hibDataSet).setOperation(((WSDataSetDetail)dsActiveDetailToSet).getOperation());
         
        }

        else if(dsActiveDetailToSet instanceof JClassDataSetDetail){
          hibDataSet=new SbiJClassDataSet();
          if(((JClassDataSetDetail)dsActiveDetailToSet).getJavaClassName()!=null){
            ((SbiJClassDataSet)hibDataSet).setJavaClassName(((JClassDataSetDetail)dsActiveDetailToSet).getJavaClassName());
          }
        }

        else if(dsActiveDetailToSet instanceof ScriptDataSetDetail){
          hibDataSet=new SbiScriptDataSet();
          if(((ScriptDataSetDetail)dsActiveDetailToSet).getScript()!=null){
            ((SbiScriptDataSet)hibDataSet).setScript(((ScriptDataSetDetail)dsActiveDetailToSet).getScript());
          }
          if(((ScriptDataSetDetail)dsActiveDetailToSet).getLanguageScript()!=null){
            ((SbiScriptDataSet)hibDataSet).setLanguageScript(((ScriptDataSetDetail)dsActiveDetailToSet).getLanguageScript());
          }
        }

        SbiDomains transformer = null;
        if (dsActiveDetailToSet.getTransformerId() != null){
          Criterion aCriterion = Expression.eq("valueId",  dsActiveDetailToSet.getTransformerId());
          Criteria criteria = aSession.createCriteria(SbiDomains.class);
          criteria.add(aCriterion);
          transformer = (SbiDomains) criteria.uniqueResult();
          if (transformer == null){
            logger.error("The Domain with value_id= "+dsActiveDetailToSet.getTransformerId()+" does not exist.");
            throw new EMFUserError(EMFErrorSeverity.ERROR, 1035);
          }
        }

        SbiDomains category = null;
        if (dsActiveDetailToSet.getCategoryId()!= null){
          Criterion aCriterion = Expression.eq("valueId",  dsActiveDetailToSet.getCategoryId());
          Criteria criteria = aSession.createCriteria(SbiDomains.class);
          criteria.add(aCriterion)
          category = (SbiDomains) criteria.uniqueResult()
          if (category == null){
            logger.error("The Domain with value_id= "+dsActiveDetailToSet.getCategoryId()+" does not exist.");
View Full Code Here

    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      Criterion labelCriterrion = Expression.eq("label", label);
      Criteria criteria = aSession.createCriteria(SbiDataSetConfig.class);
      criteria.add(labelCriterrion)
      SbiDataSetConfig hibDS = (SbiDataSetConfig) criteria.uniqueResult();
      if (hibDS == null) return null;
View Full Code Here

    Session tmpSession = null;
    Transaction tx = null;
    try {
      tmpSession = getSession();
      tx = tmpSession.beginTransaction();
      Criterion labelCriterrion = Expression.eq("label", label);
      Criteria criteria = tmpSession.createCriteria(SbiUdp.class);
      criteria.add(labelCriterrion)
      SbiUdp hibUDP = (SbiUdp) criteria.uniqueResult();
      if (hibUDP == null) return null;
      udp = toUdp(hibUDP);       
View Full Code Here

    Transaction tx = null;
    try {
      tmpSession = getSession();
      tx = tmpSession.beginTransaction();
      // get familyId
      Criterion labelCriterrionFam = Expression.eq("valueCd", family)
      Criteria criteria = tmpSession.createCriteria(SbiDomains.class);
      criteria.add(labelCriterrionFam)
      Criterion labelCriterrionFamDom = Expression.eq("domainCd", "UDP_FAMILY")
      criteria.add(labelCriterrionFamDom)
      SbiDomains famiDom = (SbiDomains) criteria.uniqueResult();
      if (famiDom == null) return null;

      Criterion labelCriterrion = Expression.eq("label", label);
      Criteria criteria2 = tmpSession.createCriteria(SbiUdp.class);
      criteria2.add(labelCriterrion)
      Criterion famCriterrion = Expression.eq("familyId", famiDom.getValueId());
      criteria2.add(famCriterrion)

      SbiUdp hibUDP = (SbiUdp) criteria2.uniqueResult();
      if (hibUDP == null) return null;
      udp = toUdp(hibUDP);       
View Full Code Here

TOP

Related Classes of org.hibernate.criterion.Criterion

Copyright © 2018 www.massapicom. 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.