随笔 - 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 阅读(214) | 评论 (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 阅读(227) | 评论 (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 阅读(384) | 评论 (0)编辑 收藏