可以呀
而且我觉得这个还是比较方便的
配置log4j,然后在每一个set方法里面记录原来的数据和修改后的数据

解决方案 »

  1.   

    关键是我们头现在不知道什么原因,不让我用log4j,包括现在日志表都是我重新设计的。不用log4j我该怎么处理呢
      

  2.   

    hibernate 报错:
    net.sf.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of w15.Customer.setId
     
    是one-to-many哪里出问题了? 有高手可否帮忙看一下?
      

  3.   

    public class PreparedStatementProxy implements InvocationHandler{
      private PreparedStatemnet ps;
      public PreparedStatementProxy(Connection conn,String sql){
        ps=conn.prepareStatement(sql);
      }  public PreparedStatemnet prepareStatement(){
        Class c=ps.getClass();
        Class[] cls=c.getInterface();
        if(cls.length==0){    }
      }}
      

  4.   

    不好意思,点错了
    public class PreparedStatementProxy implements InvocationHandler{
      private PreparedStatemnet ps;
      public PreparedStatementProxy(Connection conn,String sql){
        ps=conn.prepareStatement(sql);
      }  public PreparedStatemnet prepareStatement(){
        Class c=ps.getClass();
        Class[] cls=c.getInterface();
        if(cls.length==0){
       cls=new Class[]{PreparedStatemnet.class};
        }
        return (PreparedStatement)Proxy.newProxyInstance(c.getClassLoader(),cls,this);
      }  public Object invoke(Object proxy, Method method, Object[] args){
        if(method.getName().starts("set")){
           //调用了PreparedStatement的setX方法,在这里记载所有的修改
        }
        return method.invoke(ps,args);
      }
    }//Connection conn=...;
    PreparedStatement ps=new PreparedStatement(conn,sql).prepareStatement();
    其它地方就不用修改了。
      

  5.   

    不好意思啊,上面的,我们不是用DAO做的。我们处理修改操作是将actionform中数据放到dto中,然后调用sessionfacade的update方法,直接更新数据。
      

  6.   

    整个csdn没一个人这个问题吗???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????