<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    一個Hibernate多條件查詢的demo

    Posted on 2009-08-16 11:14 Robert Su 閱讀(658) 評論(0)  編輯  收藏 所屬分類: 工程相關
        public List findByInstance(IInsInfo instance) {
            log.debug(
    "finding IInsInfo instances with given IInsInfo instance");
            
    try {
                Criteria crit 
    = getSession().createCriteria(instance.getClass());
                Criterion iname 
    = null, gdfield = null, kind = null, property = null;
                Conjunction conjunction 
    = Restrictions.conjunction();// 合取
                
    //
                if (instance.getIname() != null)
                    
    if (!instance.getIname().equals(null)) {
                        iname 
    = Restrictions.like("iname""%"
                                
    + instance.getIname() + "%");
                        conjunction.add(iname);
                    }
                
    if (instance.getGdfield() != null)
                    
    if (!instance.getGdfield().equals("")) {
                        gdfield 
    = Restrictions.eq("gdfield", instance.getGdfield());
                        conjunction.add(gdfield);
                    }
                
    if (instance.getKind() != null)
                    
    if (!instance.getKind().equals("")) {
                        kind 
    = Restrictions.eq("kind", instance.getKind());
                        conjunction.add(kind);
                    }
                
    if (instance.getProperty() != null)
                    
    if (!instance.getProperty().equals("")) {
                        property 
    = Restrictions.eq("property", instance
                                .getProperty());
                        conjunction.add(property);
                    }

                crit.add(conjunction);
                
    return crit.list();
            } 
    catch (RuntimeException re) {
                log.error(
    "find by IInsInfo instance failed", re);
                
    throw re;
            }
        }

    posts - 103, comments - 104, trackbacks - 0, articles - 5

    Copyright © Robert Su

    主站蜘蛛池模板: 亚洲第一AAAAA片| 亚洲AV无码成人精品区大在线| 亚洲人成无码网站| 国产日韩久久免费影院| 亚洲精品老司机在线观看| 四虎精品成人免费视频| 亚洲国产婷婷综合在线精品| 美女的胸又黄又www网站免费| 可以免费观看的一级毛片| 国产产在线精品亚洲AAVV| 亚洲国产精品无码久久九九| 精品一区二区三区免费毛片| 亚洲AⅤ无码一区二区三区在线| 老司机午夜免费视频| 国产亚洲人成网站在线观看| 国产一级a毛一级a看免费人娇| 亚洲国产精品va在线播放| 日韩中文字幕免费视频| 亚洲国产成人超福利久久精品 | 九九九国产精品成人免费视频| 亚洲精品国产高清不卡在线| 中文在线日本免费永久18近| 亚洲AV日韩精品久久久久久| 亚洲第一网站免费视频| 亚洲深深色噜噜狠狠网站| 国产成人aaa在线视频免费观看| 日韩在线视频线视频免费网站| 亚洲精品无码午夜福利中文字幕| 免费h视频在线观看| 亚洲免费视频观看| 国产aa免费视频| 中文字幕视频在线免费观看| 亚洲最大的成网4438| 免费无码又爽又刺激高潮的视频| 春意影院午夜爽爽爽免费| 亚洲国产精品人久久| 好爽…又高潮了毛片免费看| 岛国精品一区免费视频在线观看| 久久亚洲精品人成综合网| 国产精品免费视频播放器| 青青操视频在线免费观看|