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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? hibernateworkflowstore.java

?? 一個(gè)很好實(shí)用的工作流OSWORKFLOW開發(fā)例子.有著非常優(yōu)秀的靈活性.
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
/* * 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);        }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人国产精品免费观看| 欧美性三三影院| 香蕉久久一区二区不卡无毒影院| 精品国产乱码久久久久久图片| 99精品欧美一区二区三区综合在线| 免费看日韩a级影片| 最新中文字幕一区二区三区| 精品久久国产97色综合| 欧美日韩亚洲综合在线| 99在线精品免费| 国产精品一区二区黑丝 | 亚洲18色成人| 亚洲三级在线观看| 中文av一区特黄| 精品乱码亚洲一区二区不卡| 欧美肥妇毛茸茸| 欧美午夜片在线看| 91美女视频网站| 成人国产精品视频| 国产99一区视频免费| 久久99精品久久久久婷婷| 日韩av网站免费在线| 亚洲成av人影院| 亚洲曰韩产成在线| 亚洲激情第一区| 中文字幕一区在线观看视频| 国产亚洲精品资源在线26u| 精品国产免费人成电影在线观看四季| 欧美三区在线视频| 精品视频在线免费| 欧美视频一二三区| 欧亚洲嫩模精品一区三区| 色婷婷久久综合| 色诱视频网站一区| 在线观看不卡一区| 欧美综合欧美视频| 欧洲精品一区二区| 欧美性高清videossexo| 欧美日韩大陆在线| 在线播放中文一区| 欧美二区乱c少妇| 欧美一区二区人人喊爽| 中文字幕在线不卡国产视频| |精品福利一区二区三区| 亚洲欧美日韩久久精品| 亚洲精品中文在线影院| 一区二区三区 在线观看视频| 亚洲靠逼com| 午夜精品久久久久久| 日本视频免费一区| 激情深爱一区二区| 成人免费视频一区二区| 色综合久久88色综合天天| 欧美日韩在线不卡| 精品少妇一区二区三区视频免付费 | 国产婷婷色一区二区三区四区| 国产喷白浆一区二区三区| 国产精品福利影院| 伊人一区二区三区| 日本va欧美va精品| 国产在线精品不卡| 99久久精品国产导航| 欧美日韩精品一区二区三区 | 欧美日韩一区二区三区免费看| 7799精品视频| 国产欧美精品区一区二区三区 | 久久久久国产精品人| 国产精品白丝在线| 婷婷久久综合九色国产成人| 久久99国产精品成人| 成人app网站| 欧美精品在线一区二区| 国产天堂亚洲国产碰碰| 亚洲午夜久久久久久久久久久| 麻豆国产精品视频| 成人高清免费在线播放| 欧美日韩视频在线观看一区二区三区 | 亚洲一二三四在线| 国产呦萝稀缺另类资源| 色94色欧美sute亚洲线路二| 欧美mv日韩mv| 亚洲精品中文字幕乱码三区| 狠狠色丁香久久婷婷综| 在线观看日韩精品| 久久综合狠狠综合| 国产精品一区二区在线观看网站| 99久久婷婷国产| 日韩精品中文字幕一区| 亚洲欧洲成人精品av97| 男女男精品视频| 色吧成人激情小说| 精品对白一区国产伦| 亚洲午夜精品网| 懂色av中文字幕一区二区三区| 欧美美女激情18p| 中文字幕在线一区| 久久精品国产99国产精品| 在线免费观看一区| 国产欧美日韩麻豆91| 日本aⅴ亚洲精品中文乱码| 日本乱人伦一区| 国产欧美精品国产国产专区| 久久国产人妖系列| 欧美伊人精品成人久久综合97 | 欧美私模裸体表演在线观看| 亚洲国产精品精华液ab| 久久国产精品99久久人人澡| 在线观看日韩国产| 亚洲少妇最新在线视频| 国产激情视频一区二区在线观看 | 97久久超碰国产精品电影| 精品毛片乱码1区2区3区| 午夜久久电影网| 在线免费观看成人短视频| 综合久久久久久久| 国产98色在线|日韩| 精品国产乱码久久久久久夜甘婷婷 | 寂寞少妇一区二区三区| 欧美精品九九99久久| 一级日本不卡的影视| 97se亚洲国产综合自在线不卡| 国产欧美视频在线观看| 激情综合一区二区三区| 日韩欧美一级精品久久| 人人狠狠综合久久亚洲| 欧美一区二视频| 美女网站在线免费欧美精品| 91精品国产综合久久精品图片| 亚洲国产精品欧美一二99| 欧美亚日韩国产aⅴ精品中极品| 亚洲精品videosex极品| 欧美中文字幕不卡| 亚洲午夜久久久久中文字幕久| 色av成人天堂桃色av| 亚洲综合999| 欧美图片一区二区三区| 99免费精品在线| 国产精品久久久久久久久免费樱桃 | 色香蕉久久蜜桃| 一区二区三区在线高清| 99精品欧美一区二区三区小说 | 国产日韩v精品一区二区| 国产美女视频91| 欧美激情艳妇裸体舞| 99riav一区二区三区| 亚洲激情校园春色| 欧美日本在线一区| 九一久久久久久| 国产精品免费免费| 色欧美88888久久久久久影院| 亚洲综合色区另类av| 欧美美女视频在线观看| 精品一区二区三区视频 | 亚洲黄色尤物视频| 欧美日韩不卡视频| 韩国女主播成人在线观看| 欧美激情中文字幕一区二区| av福利精品导航| 亚洲成人资源在线| 精品成a人在线观看| 99麻豆久久久国产精品免费| 亚洲6080在线| www久久精品| 色综合天天狠狠| 日本麻豆一区二区三区视频| 国产午夜精品在线观看| 91福利在线免费观看| 麻豆精品视频在线观看| 国产精品视频一二三区 | 精品久久久久久亚洲综合网 | 99精品欧美一区二区三区小说| 国产91综合一区在线观看| 中文字幕中文字幕一区二区| 欧美挠脚心视频网站| 国产一区二区三区观看| 亚洲精品伦理在线| 欧美videos中文字幕| 色综合天天狠狠| 激情欧美一区二区三区在线观看| 成人免费在线观看入口| 宅男噜噜噜66一区二区66| 9色porny自拍视频一区二区| 日韩电影在线一区| 国产精品灌醉下药二区| 日韩免费高清视频| 色婷婷久久综合| 国产成人精品影视| 视频一区二区国产| 中文字幕一区免费在线观看| 日韩一区二区三区av| 色综合久久99| 国产精品1区2区3区| 香蕉av福利精品导航 | 免费在线观看成人| 亚洲三级理论片| 久久亚洲综合色| 欧美精品久久久久久久多人混战| 成人免费毛片片v| 看电影不卡的网站| 一区二区不卡在线视频 午夜欧美不卡在|