随笔 - 23  文章 - 3  trackbacks - 0
<2006年6月>
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

常用链接

留言簿(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)编辑 收藏
org.hibernate.hql.QuerySplitter - no persistent classes found for query class:
意味着你没有将someclass的配置文件放在hibernate.config或没有写配置文件。
posted @ 2006-07-04 10:30 aimy 阅读(1169) | 评论 (0)编辑 收藏
1,通过构造函数创建bean
 <bean id="baseDAO" class="com.aimy.core.dao.impl.BaseDAOImpl">
相当于
basedaoimpl baseDAO 
= new BaseDAOImpl();
2,通过静态工厂创建bean
<bean id="driver1" class="com.aimy.driver.driverManager"
factory
-method="createInstance"/>
相当于
Object driver1 
= driverManager.createInstance();

其中没有指定driverManager.createInstance();返回对象的类型,而且createInstance()必须是static方法
3,通过实例工厂方法创建bean
<bean id="father" class="com.aimy.Father"/>
........
<bean id="son" factory-bean="father" factory-method="createSon"/>
相当于
Father father 
= new Father();
Object son 
= father.createSon();

其中father和son必须在同一个bean工厂或父bean工厂,即在同一个applicationcontext或子applicationcontext


二、如果applicationcontext默认预实例化那些singleton bean,这样就可以在beanfactory装载时就检查出错误,而如果singleton bean设置为lazy-mode,
posted @ 2006-06-26 23:26 aimy 阅读(233) | 评论 (0)编辑 收藏
hibernate 保存空值的细节
1。如果字段在pojo类中是复杂对象类型,则在数据库用nulll表示。
2。如果字段在pojo类中是简单数据类型,则在数据库用0表示。
posted @ 2006-06-26 09:56 aimy 阅读(170) | 评论 (0)编辑 收藏
1. document.name.value----->document.all.name.value
2. eval(document.all.name)---->eval('document.all.name')
3.javascript:window.history.go(-1)
4、在action方法中只要抛出exception,就会跳到jspexception页面中,怎么处理。
posted @ 2006-06-22 13:19 aimy 阅读(188) | 评论 (0)编辑 收藏