亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? hibernateworkflowstore.java

?? 一個很好實用的工作流OSWORKFLOW開發例子.有著非常優秀的靈活性.
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * Copyright (c) 2002-2003 by OpenSymphony * All rights reserved. */package com.opensymphony.workflow.spi.hibernate;import com.opensymphony.module.propertyset.PropertySet;import com.opensymphony.module.propertyset.PropertySetManager;import com.opensymphony.module.propertyset.hibernate.DefaultHibernateConfigurationProvider;import com.opensymphony.util.TextUtils;import com.opensymphony.workflow.QueryNotSupportedException;import com.opensymphony.workflow.StoreException;import com.opensymphony.workflow.query.*;import com.opensymphony.workflow.spi.Step;import com.opensymphony.workflow.spi.WorkflowEntry;import com.opensymphony.workflow.spi.WorkflowStore;import net.sf.hibernate.Criteria;import net.sf.hibernate.Hibernate;import net.sf.hibernate.HibernateException;import net.sf.hibernate.Session;import net.sf.hibernate.SessionFactory;import net.sf.hibernate.Transaction;import net.sf.hibernate.expression.Criterion;import net.sf.hibernate.expression.Expression;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import java.util.*;/** * A workflow store backed by Hibernate for persistence.  To use this with the standard * persistence factory, pass to the DefaultConfiguration.persistenceArgs the SessionFactory to * use: * <code>DefaultConfiguration.persistenceArgs.put("sessionFactory", DatabaseHelper.getSessionFactory());</code> * See the HibernateFunctionalWorkflowTestCase for more help. * */public class HibernateWorkflowStore implements WorkflowStore {    //~ Static fields/initializers /////////////////////////////////////////////    private static final Log log = LogFactory.getLog(HibernateWorkflowStore.class);    //~ Instance fields ////////////////////////////////////////////////////////    Session session;    SessionFactory sessionFactory;    //~ Constructors ///////////////////////////////////////////////////////////    public HibernateWorkflowStore() {    }    public HibernateWorkflowStore(SessionFactory sessionFactory) throws StoreException {        this.sessionFactory = sessionFactory;        try {            this.session = sessionFactory.openSession();        } catch (HibernateException he) {            log.error("constructor", he);            throw new StoreException("constructor", he);        }    }    //~ Methods ////////////////////////////////////////////////////////////////    public void setEntryState(long entryId, int state) throws StoreException {        try {            HibernateWorkflowEntry entry = (HibernateWorkflowEntry) session.find("FROM entry IN CLASS " + HibernateWorkflowEntry.class.getName() + " WHERE entry.id = ?", new Long(entryId), Hibernate.LONG).get(0);            entry.setState(state);            session.save(entry);        } catch (HibernateException e) {            log.error("An exception occured", e);            return;        }    }    public PropertySet getPropertySet(long entryId) {        HashMap args = new HashMap();        args.put("entityName", "OSWorkflowEntry");        args.put("entityId", new Long(entryId));        DefaultHibernateConfigurationProvider configurationProvider = new DefaultHibernateConfigurationProvider();        configurationProvider.setSessionFactory(sessionFactory);        args.put("configurationProvider", configurationProvider);        return PropertySetManager.getInstance("hibernate", args);    }    public Step createCurrentStep(long entryId, int stepId, String owner, Date startDate, Date dueDate, String status, long[] previousIds) throws StoreException {        HibernateCurrentStep step = new HibernateCurrentStep();        HibernateWorkflowEntry entry;        Transaction tx;        try {            tx = session.beginTransaction();            entry = (HibernateWorkflowEntry) session.find("FROM entry in CLASS " + HibernateWorkflowEntry.class.getName() + " WHERE entry.id = ?", new Long(entryId), Hibernate.LONG).get(0);        } catch (HibernateException he) {            log.error("Looking for workflow entry " + entryId, he);            throw new StoreException("Looking for workflow entry " + entryId, he);        }        step.setEntry(entry);        step.setStepId(stepId);        step.setOwner(owner);        step.setStartDate(startDate);        step.setDueDate(dueDate);        step.setStatus(status);        List stepIdList = new ArrayList(previousIds.length);        for (int i = 0; i < previousIds.length; i++) {            long previousId = previousIds[i];            stepIdList.add(new Long(previousId));        }        if (!stepIdList.isEmpty()) {            String stepIds = TextUtils.join(", ", stepIdList);            try {                step.setPreviousSteps(session.find("FROM step in CLASS " + HibernateCurrentStep.class.getName() + " WHERE step.id IN (" + stepIds + ")"));            } catch (HibernateException he) {                log.error("Looking for step in " + stepIds, he);                throw new StoreException("Looking for step in " + stepIds, he);            }        } else {            step.setPreviousSteps(Collections.EMPTY_LIST);        }        if (entry.getCurrentSteps() == null) {            ArrayList cSteps = new ArrayList(1);            cSteps.add(step);            entry.setCurrentSteps(cSteps);        } else {            entry.getCurrentSteps().add(step);        }        try {            session.save(entry);            tx.commit();            //session.save(step);            return step;        } catch (HibernateException he) {            log.error("Saving new workflow entry", he);            throw new StoreException("Saving new workflow entry", he);        }    }    public WorkflowEntry createEntry(String workflowName) throws StoreException {        HibernateWorkflowEntry entry = new HibernateWorkflowEntry();        entry.setState(WorkflowEntry.CREATED);        entry.setWorkflowName(workflowName);        Transaction tx;        try {            tx = session.beginTransaction();            session.save(entry);            tx.commit();        } catch (HibernateException he) {            log.error("Saving new workflow entry", he);            throw new StoreException("Saving new workflow entry", he);        }        return entry;    }    public List findCurrentSteps(long entryId) throws StoreException {        HibernateWorkflowEntry entry;        try {            entry = (HibernateWorkflowEntry) session.find("FROM entry in CLASS " + HibernateWorkflowEntry.class.getName() + " WHERE entry.id = ?", new Long(entryId), Hibernate.LONG).get(0);        } catch (HibernateException he) {            log.error("Looking for entryId " + entryId, he);            throw new StoreException("Looking for entryId " + entryId, he);        }        try {            return session.find("FROM step IN CLASS " + HibernateCurrentStep.class.getName() + " WHERE step.entry = ?", entry, Hibernate.entity(entry.getClass()));        } catch (HibernateException he) {            log.error("Looking for step id" + entry, he);            throw new StoreException("Looking for step id" + entry, he);        }    }    public WorkflowEntry findEntry(long entryId) throws StoreException {        try {            List result = session.find("FROM entry IN CLASS " + HibernateWorkflowEntry.class.getName() + " WHERE entry.id = ?", new Long(entryId), Hibernate.LONG);            return (WorkflowEntry) result.get(0);        } catch (HibernateException he) {            log.error("Looking for entry " + entryId, he);            throw new StoreException("Loooking for entry " + entryId, he);        }    }    public List findHistorySteps(long entryId) throws StoreException {        HibernateWorkflowEntry entry;        try {            entry = (HibernateWorkflowEntry) session.find("FROM entry in CLASS " + HibernateWorkflowEntry.class.getName() + " WHERE entry.id = ?", new Long(entryId), Hibernate.LONG).get(0);        } catch (HibernateException he) {            log.error("Finding entry " + entryId, he);            throw new StoreException("Finding entry " + entryId, he);        }        try {            return session.find("FROM step IN CLASS " + HibernateHistoryStep.class.getName() + " WHERE step.entry = ?", entry, Hibernate.entity(entry.getClass()));        } catch (HibernateException he) {            log.error("Looking for step with entry " + entry, he);            throw new StoreException("Looking for step with entry " + entry, he);        }    }    public void init(Map props) throws StoreException {        try {            //if(1==2){            sessionFactory = (SessionFactory) props.get("sessionFactory");            session = sessionFactory.openSession();            //}        } catch (HibernateException he) {            log.error("Setting sessionFactory", he);            throw new StoreException("Setting sessionFactory", he);        }    }    public Step markFinished(Step step, int actionId, Date finishDate, String status, String caller) throws StoreException {        HibernateCurrentStep currentStep = (HibernateCurrentStep) step;        currentStep.setActionId(actionId);        currentStep.setFinishDate(finishDate);        currentStep.setStatus(status);        currentStep.setCaller(caller);        try {            Transaction tx = session.beginTransaction();            session.save(currentStep);            tx.commit();            return currentStep;        } catch (HibernateException he) {            log.error("Saving current step with action " + actionId, he);            throw new StoreException("Saving current step with action " + actionId, he);        }    }    public void moveToHistory(Step step) throws StoreException {        HibernateWorkflowEntry entry;        Transaction tx;        try {            tx = session.beginTransaction();            entry = (HibernateWorkflowEntry) session.find("FROM entry IN CLASS " + HibernateWorkflowEntry.class.getName() + " WHERE entry.id = ?", new Long(step.getEntryId()), Hibernate.LONG).get(0);        } catch (HibernateException he) {            log.error("Looking for workflow entry " + step.getEntryId(), he);            throw new StoreException("Looking for workflow entry " + step.getEntryId(), he);        }        HibernateHistoryStep hStep = new HibernateHistoryStep((HibernateStep) step);        entry.getCurrentSteps().remove(step);        if (entry.getHistorySteps() == null) {            ArrayList hSteps = new ArrayList(1);            hSteps.add(hStep);            entry.setHistorySteps(hSteps);        } else {            entry.getHistorySteps().add(hStep);        }        try {            session.save(hStep);            session.save(entry);            tx.commit();            //session.delete(step);            //session.save(hStep, new Long(hStep.getId()));        } catch (HibernateException he) {            log.error("Saving workflow entry " + entry.getId(), he);            throw new StoreException("Saving workflow entry " + entry.getId(), he);        }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲免费av在线| 国产精品萝li| 亚洲激情一二三区| 欧美一区二区三区免费在线看 | 久久精品亚洲乱码伦伦中文 | 91视频免费看| 日韩vs国产vs欧美| 中文字幕精品三区| 日韩无一区二区| 97久久超碰国产精品| 日本在线播放一区二区三区| 亚洲精品国产精华液| 日本一区二区三区国色天香 | 日韩欧美国产综合| 色综合久久久久网| 国产九九视频一区二区三区| 亚洲成在人线免费| 亚洲精品大片www| 国产精品超碰97尤物18| 精品国产一区久久| 欧美一区二区在线看| 日韩欧美激情四射| 在线中文字幕一区| 蜜臀久久99精品久久久久宅男| 精品粉嫩超白一线天av| 日韩欧美国产一区在线观看| 欧美一区二区三区免费| 欧美一区二区三区小说| 欧美精品乱人伦久久久久久| 欧美三级三级三级| 色吧成人激情小说| 欧美视频一区二区在线观看| 91碰在线视频| 欧美成人欧美edvon| 91精品福利在线一区二区三区 | 国产成人精品亚洲日本在线桃色| 色狠狠av一区二区三区| 精品国产乱子伦一区| 精品国产伦一区二区三区观看方式 | 毛片不卡一区二区| 成人av在线一区二区| 欧美成人艳星乳罩| 欧洲亚洲国产日韩| 精品噜噜噜噜久久久久久久久试看 | 亚洲一区二区3| 秋霞影院一区二区| 国产成人啪免费观看软件| 波多野结衣精品在线| 欧美日韩国产成人在线91| 久久久亚洲精华液精华液精华液| 亚洲色图在线播放| 日本女人一区二区三区| 成人毛片在线观看| 91精品久久久久久久91蜜桃| 国产欧美精品在线观看| 亚洲午夜在线视频| 国产成人av福利| 欧美日韩一区不卡| 欧美激情一区二区| 午夜成人在线视频| 成人教育av在线| 日韩欧美激情一区| 亚洲精品欧美激情| 国产一区二区三区四| 欧美亚洲精品一区| 国产精品日韩精品欧美在线| 日日夜夜精品视频天天综合网| 国产一区二区0| 欧美揉bbbbb揉bbbbb| 国产精品三级电影| 韩国在线一区二区| 欧美久久免费观看| 自拍偷拍欧美激情| 国产精品99久久久| 678五月天丁香亚洲综合网| 中文字幕制服丝袜一区二区三区| 九九视频精品免费| 欧美日韩在线电影| 亚洲色图欧美激情| 国产成人精品影院| 欧美大白屁股肥臀xxxxxx| 亚洲一区中文日韩| 色婷婷久久久久swag精品| 久久久精品综合| 久久99精品一区二区三区三区| 欧美日韩在线电影| 一区二区三区四区激情| 99精品视频在线观看免费| 久久久电影一区二区三区| 六月丁香婷婷久久| 欧美一级片在线看| 日韩影院在线观看| 欧美色视频在线| 久久爱另类一区二区小说| 欧美视频中文一区二区三区在线观看| 国产精品久久久久久久裸模| 国产精品一二三| 久久亚洲免费视频| 韩国v欧美v亚洲v日本v| 欧美v亚洲v综合ⅴ国产v| 免播放器亚洲一区| 欧美一三区三区四区免费在线看| 精品91自产拍在线观看一区| 久久疯狂做爰流白浆xx| 91精品蜜臀在线一区尤物| 日日夜夜免费精品视频| 欧美一区二区三区在线观看| 日本视频免费一区| 日韩欧美视频一区| 韩国v欧美v亚洲v日本v| 欧美精品一区二区三区视频| 韩国一区二区视频| 日本一区二区视频在线| 成人免费看黄yyy456| 最新国产の精品合集bt伙计| 99精品桃花视频在线观看| 亚洲精品日日夜夜| 欧美日韩中文字幕一区二区| 亚洲成av人影院在线观看网| 欧美狂野另类xxxxoooo| 日韩成人一区二区| 久久新电视剧免费观看| 国产成人av一区| 亚洲欧美日韩系列| 欧美日韩成人一区| 美腿丝袜一区二区三区| 久久久亚洲欧洲日产国码αv| 国产91丝袜在线播放九色| ...xxx性欧美| 欧美日韩一区三区四区| 久久疯狂做爰流白浆xx| 欧美国产在线观看| 色婷婷综合五月| 青青草伊人久久| 欧美激情一区二区| 在线国产亚洲欧美| 免费人成在线不卡| 国产视频一区二区在线| 91一区二区三区在线播放| 亚洲妇女屁股眼交7| 日韩免费观看2025年上映的电影| 国产激情一区二区三区四区| 亚洲人快播电影网| 日韩欧美亚洲一区二区| av电影在线观看完整版一区二区| 亚洲制服丝袜在线| 337p日本欧洲亚洲大胆色噜噜| 成人晚上爱看视频| 五月天精品一区二区三区| 亚洲精品一区二区三区福利| 91丨九色丨尤物| 精品一区在线看| 亚洲视频免费在线| 欧美变态tickle挠乳网站| av成人老司机| 免费观看91视频大全| 国产精品国产三级国产| 欧美一区二区三区在线视频 | 日韩欧美国产一区二区在线播放| 国产iv一区二区三区| 五月激情综合婷婷| 国产精品美女一区二区在线观看| 欧美高清视频不卡网| 粉嫩嫩av羞羞动漫久久久| 亚洲成人免费视频| 国产精品美女久久久久av爽李琼| 欧美精品国产精品| 91网址在线看| 国产乱码精品一区二区三区五月婷| 亚洲欧美偷拍三级| 国产亚洲欧洲997久久综合| 欧美伦理电影网| 91麻豆国产福利在线观看| 精东粉嫩av免费一区二区三区| 一区二区三区资源| 日本一区二区三区视频视频| 欧美一区二区精品久久911| 91看片淫黄大片一级在线观看| 精品亚洲国内自在自线福利| 夜夜亚洲天天久久| 国产精品传媒入口麻豆| 久久这里只有精品首页| 91精品国产免费久久综合| 在线亚洲高清视频| 成人av午夜电影| 国产一区欧美日韩| 免费日韩伦理电影| 午夜精品福利一区二区蜜股av | 国产精品亚洲а∨天堂免在线| 日韩国产欧美在线播放| 亚洲黄色av一区| 最新欧美精品一区二区三区| 国产视频一区在线播放| 欧美成人官网二区| 日韩欧美一区在线| 91精品国产麻豆| 欧美美女视频在线观看| 欧美在线色视频| 欧美三级三级三级| 欧美在线视频不卡|