隨筆 - 23  文章 - 3  trackbacks - 0
          <2006年7月>
          2526272829301
          2345678
          9101112131415
          16171819202122
          23242526272829
          303112345

          常用鏈接

          留言簿(1)

          隨筆檔案

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          注意writer的參數有多個,特別是有一個boolean的參數決定刷新或在附加文本

          ????????????log? = ?? new ?PrintWriter( new ?FileOutputStream(fl, true ), true );
          ????????????SimpleDateFormat?df?
          = ? new ?SimpleDateFormat( " yyyy.MM.dd?'at'?hh:mm:ss\n "
          );
          ????????????Date?now?
          = ? new
          ?Date();
          ????????????String?dateformat?
          =
          ?df.format(now)
          ????????????BufferedWriter?bf??
          = ? new ?BufferedWriter( new ?FileWriter(fl,? true
          ));
          ????????????bf.append(dateformat);
          ????????????bf.close();
          ????????????log.println(
          " start?connection?databse: "
          );
          ????????????log.println(
          " driver?name: " .concat(driveName);


          輸出的結果示例:
          2006.12.12?at?10:21:13
          start?connection?databse:
          driver?name:oracle.jdbc.driver.OracleDriver

          posted @ 2006-12-12 12:16 aimy 閱讀(222) | 評論 (0)編輯 收藏
          1、org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.xindeco.business.pojo.NonageRegister#82]
          ?at org.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundException.java:27)
          ?at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:65)
          ?at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(ApplicationFilterChain.java:252)
          ?at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
          ?at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
          ?at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
          ?at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
          ?at org.apache.catalina.core.ApplicationDispatcher.forward

          錯誤的原因:
          在nonregsiter中已經手動刪除了id=‘82’的記錄,而在WF_task以及wf-proces中還有bizclass = '3' && bizId = '82'的記錄,只要刪除wf-task中相應的記錄.
          posted @ 2006-07-09 16:17 aimy 閱讀(233) | 評論 (0)編輯 收藏

          ProcessInstance.hbm.xml:

          <? xml?version = " 1.0 " ?encoding = " UTF-8 " ?>

          <! DOCTYPE?hibernate - mapping?PUBLIC
          ????
          " -//Hibernate/Hibernate?Mapping?DTD?3.0//EN " ?
          ????
          " http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd " >

          < hibernate - mapping
          >
          ????
          < class
          ????????name
          = " com.xindeco.workflow.ProcessInstance "
          ????????table
          = " WF_PROCESS "
          ????????dynamic
          - update = " true "
          ????????dynamic
          - insert = " true "
          ????????select
          - before - update = " false "
          ????????optimistic
          - lock = " version "
          ????
          >

          ????????
          < id
          ????????????name
          = " ID "
          ????????????column
          = " ID "
          ????????????type
          = " long "
          ????????????length
          = " 30 "
          ????????
          >
          ????????????
          < generator? class = " native " >
          ????????????
          </ generator >
          ????????
          </ id >

          ????????
          < discriminator
          ????????????column
          = " bizClass "
          ????????????type
          = " string "
          ????????
          />
          ????????
          ????????
          < property
          ????????????name
          = " state "
          ????????????type
          = " java.lang.Integer "
          ????????????update
          = " true "
          ????????????insert
          = " true "
          ????????????access
          = " property "
          ????????????column
          = " state "
          ????????????length
          = " 10 "
          ????????
          />
          ????????
          ????????
          < many - to - one
          ????????????name
          = " flow "
          ????????????
          class = " com.xindeco.workflow.WFFlow "
          ????????????cascade
          = " none "
          ????????????outer
          - join = " auto "
          ????????????update
          = " true "
          ????????????insert
          = " true "
          ????????????access
          = " property "
          ????????????column
          = " flowId "
          ????????
          />

          ????????
          < set
          ????????????name
          = " tasks "
          ????????????lazy
          = " true "
          ????????????inverse
          = " true "
          ????????????cascade
          = " delete "
          ????????????sort
          = " unsorted "
          ????????
          >

          ??????????????
          < key
          ??????????????????column
          = " processId "
          ??????????????
          >
          ??????????????
          </ key >

          ??????????????
          < one - to - many
          ??????????????????
          class = " com.xindeco.workflow.WFTask "
          ??????????????
          />

          ????????
          </ set >

          ????
          </ class >

          </ hibernate - mapping >

          CollRegPI.hbm.xml:

          <?xml?version="1.0"?>
          <!DOCTYPE?hibernate-mapping?PUBLIC
          ??????
          "-//Hibernate/Hibernate?Mapping?DTD?3.0//EN"
          ??????????
          "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

          <hibernate-mapping?default-access="field"?>

          ??
          <subclass?name="com.xindeco.business.pojo.wf.CollRegPI"
          ????????????discriminator
          -value="2"
          ????????????
          extends="com.xindeco.workflow.ProcessInstance"
          ????????????lazy
          ="false">

          ????????????
          <many-to-one?name="collReg"
          ?????????????????
          class="com.xindeco.business.pojo.CollReg"
          ?????????????????column
          ="bizId"
          ?????????????????cascade
          ="none"/>
          </subclass>
          </hibernate-mapping>

          數據庫的數據:
          ???? id??? flowid????bizId???bizClass???state
          ??21????? ?2????????? ?9 ???????? 2???????? ???? 0
          ?22???????? 2???????? 10???????? 2???????????? ?0
          ?23???????? 2???????? 11???????? 2??????????????0
          ?24???????? 2???????? 12???????? 2????????????? 0
          ?25???????? 2???????? 13???????? 2????????????? 0
          ?26???????? 2???????? 14???????? 2????????????? 0
          ?29???????? 2???????? 17???????? 2???????????? ?0
          ?30???????? 2???????? 18???????? 2??????????? ? 1
          ?44????? ?? 4?????? ??1?????? ?? 32????? ?????? 0
          ?45????? ?? 4?????? ? 2?????? ??? 32????? ?????? 1
          ?46????? ?? 5??????????1??????????33?????????????0
          ?47?????? ? 5??????????2???????????33?????????????1
          ?48??????? ?5??????????3???????????33????? ?????? 0
          ?50????? ? ?3????????? 1????????????3??????????????0
          ?51????? ? ?3???????? 1????????????3??????????????0

          如果bizclass=2是同一種類型的class。由????????
          ?????????<discriminator
          ????????????column
          ="bizClass"
          ????????????type
          ="string"
          ????????
          />來表示。
          posted @ 2006-07-06 10:37 aimy 閱讀(391) | 評論 (0)編輯 收藏
          org.hibernate.hql.QuerySplitter - no persistent classes found for query class:
          意味著你沒有將someclass的配置文件放在hibernate.config或沒有寫配置文件。
          posted @ 2006-07-04 10:30 aimy 閱讀(1174) | 評論 (0)編輯 收藏
          主站蜘蛛池模板: 宜黄县| 礼泉县| 盘锦市| 磴口县| 岐山县| 东乡县| 大悟县| 洱源县| 平原县| 宁陵县| 横峰县| 吴川市| 凤阳县| 玉田县| 香港 | 揭西县| 襄垣县| 巴彦淖尔市| 弋阳县| 正蓝旗| 安龙县| 神农架林区| 浦江县| 栾城县| 崇阳县| 东丽区| 宁明县| 高邑县| 连州市| 盘锦市| 惠州市| 康乐县| 高邮市| 潼南县| 平谷区| 集贤县| 广德县| 东山县| 南安市| 桐乡市| 石楼县|