Package org.hibernate.criterion

Examples of org.hibernate.criterion.Criterion


    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiKpi hibKpi = (SbiKpi) aSession.load(SbiKpi.class, kpiId);
      SbiObjects hibObject = (SbiObjects) aSession.load(SbiObjects.class, docId);
      Criterion kpiCriterrion = Expression.eq("sbiKpi",hibKpi);
      Criterion sbiObjCriterrion = Expression.eq("sbiObjects",hibObject);
      Criteria crit = aSession.createCriteria(SbiKpiDocument.class);
      crit.add(kpiCriterrion);
      crit.add(sbiObjCriterrion);
      SbiKpiDocument kpiDoc = (SbiKpiDocument) crit.uniqueResult();
      toReturn = toKpiDoc(kpiDoc);
View Full Code Here


      }



      //Loading all old sbiObjects
      Criterion kpiCriter = Expression.eq("sbiKpi",sbiKpi);
      Criteria crite = aSession.createCriteria(SbiKpiDocument.class);
      crite.add(kpiCriter);
      List existingDocs = crite.list();

      List kpiDocsList = kpi.getSbiKpiDocuments();
      Set sbiKpiDocuments = new HashSet(0);
      Iterator i = kpiDocsList.iterator();
      while (i.hasNext()) {

        KpiDocuments doc = (KpiDocuments) i.next();

        String label = doc.getBiObjLabel();
        Criterion labelCriterrion = Expression.eq("label",label);
        Criteria criteria = aSession.createCriteria(SbiObjects.class);
        criteria.add(labelCriterrion);
        SbiObjects hibObject = (SbiObjects) criteria.uniqueResult();



        Integer kpiId = kpi.getKpiId();
        Criterion kpiCriterrion = Expression.eq("sbiKpi",sbiKpi);
        Criterion sbiObjCriterrion = Expression.eq("sbiObjects",hibObject);
        Criteria crit = aSession.createCriteria(SbiKpiDocument.class);
        crit.add(kpiCriterrion);
        crit.add(sbiObjCriterrion);
        SbiKpiDocument kpiDoc = (SbiKpiDocument) crit.uniqueResult();
View Full Code Here

      Set sbiKpiDocuments = new HashSet(0);
      Iterator i = kpiDocsList.iterator();
      while (i.hasNext()) {
        KpiDocuments doc = (KpiDocuments) i.next();
        String label = doc.getBiObjLabel();
        Criterion labelCriterrion = Expression.eq("label",label);
        Criteria criteria = aSession.createCriteria(SbiObjects.class);
        criteria.add(labelCriterrion);
        SbiObjects hibObject = (SbiObjects) criteria.uniqueResult();

        SbiKpiDocument temp = new SbiKpiDocument();
View Full Code Here

    Session tmpSession = null;
    Transaction tx = null;
    try {
      tmpSession = getSession();
      tx = tmpSession.beginTransaction();
      Criterion labelCriterrion = Expression.eq("name",
          name);
      Criteria criteria = tmpSession.createCriteria(SbiGeoMaps.class);
      criteria.add(labelCriterrion)
      //List tmpLst = criteria.list();
      //return first map (unique)
View Full Code Here

    Session aSession = null;
    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      Criterion labelCriterrion = Expression.eq("code", thrCode);
      Criteria criteria = aSession.createCriteria(SbiThreshold.class);
      criteria.add(labelCriterrion);     
      SbiThreshold hibThreshold = (SbiThreshold)criteria.uniqueResult();
      if (hibThreshold == null) return null;
      toReturn = new Threshold();
View Full Code Here

    Transaction tx = null;

    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      Criterion nameCriterrion = Expression.eq("label", label);
      Criteria criteria = aSession.createCriteria(SbiKpiModelInst.class);
      criteria.add(nameCriterrion);
      SbiKpiModelInst hibSbiKpiModelInst = (SbiKpiModelInst) criteria
      .uniqueResult();
      if (hibSbiKpiModelInst == null)
View Full Code Here

    Transaction tx = null;

    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      Criterion nameCriterrion = Expression.eq("label", label);
      Criteria criteria = aSession.createCriteria(SbiKpiModelInst.class);
      criteria.add(nameCriterrion);
      SbiKpiModelInst hibSbiKpiModelInst = (SbiKpiModelInst) criteria
      .uniqueResult();
      if (hibSbiKpiModelInst == null)
View Full Code Here

    Transaction tx = null;

    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      Criterion nameCriterrion = Expression.eq("name", name);
      Criteria criteria = aSession.createCriteria(SbiKpiModelInst.class);
      criteria.add(nameCriterrion);
      criteria.add(Expression.isNull("sbiKpiModelInst"));
      List<SbiKpiModelInst> hibSbiKpiModelInsts = (List<SbiKpiModelInst>) criteria.list();
      if (hibSbiKpiModelInsts != null){
View Full Code Here

    List realResult = new ArrayList();
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();

      Criterion domainCdCriterrion = Expression
          .eq("domainCd", domainType);
      Criteria criteria = aSession.createCriteria(SbiDomains.class);
      criteria.add(domainCdCriterrion);

      List hibList = criteria.list();
View Full Code Here

    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();

      Criterion aCriterion = Expression.and(Expression.eq("domainCd",
          codeDomain), Expression.eq("valueCd", codeValue));
      Criteria criteria = aSession.createCriteria(SbiDomains.class);
      criteria.add(aCriterion);

      SbiDomains aSbiDomains = (SbiDomains) criteria.uniqueResult();
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.