少年阿宾

那些青春的岁月

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  500 Posts :: 0 Stories :: 135 Comments :: 0 Trackbacks

#

构造方法摘要
Object()
           
方法摘要
protected Object clone()
           创建并返回此对象的一个副本。
boolean equals(Object obj)
           指示某个其他对象是否与此对象“相等”。
protected void
构造方法摘要
Object()
           
方法摘要
protected Object clone()
           创建并返回此对象的一个副本。
boolean equals(Object obj)
           指示某个其他对象是否与此对象“相等”。
protected void finalize()
           当垃圾回收器确定不存在对该对象的更多引用时,由对象的垃圾回收器调用此方法。
Class<? extends Object> getClass()
           返回一个对象的运行时类。
int hashCode()
           返回该对象的哈希码值。
void notify()
           唤醒在此对象监视器上等待的单个线程。
void notifyAll()
           唤醒在此对象监视器上等待的所有线程。
String toString()
           返回该对象的字符串表示。
void wait()
           导致当前的线程等待,直到其他线程调用此对象的 notify() 方法或 notifyAll() 方法。
void wait(long timeout)
           导致当前的线程等待,直到其他线程调用此对象的 notify() 方法或 notifyAll() 方法,或者超过指定的时间量。
void wait(long timeout, int nanos)
           导致当前的线程等待,直到其他线程调用此对象的 notify() 方法或 notifyAll() 方法,或者其他某个线程中断当前线程,或者已超过某个实际时间量。

构造方法详细信息

Object
public Object()
方法详细信息

getClass
public final Class<? extends Object> getClass()
返回一个对象的运行时类。该 Class 对象是由所表示类的 static synchronized 方法锁定的对象。

返回:
表示该对象的运行时类的 java.lang.Class 对象。此结果属于类型 Class<? extends X>,其中 X 表示清除表达式中的静态类型,该表达式调用 getClass。

--------------------------------------------------------------------------------

hashCode
public int hashCode()
返回该对象的哈希码值。支持该方法是为哈希表提供一些优点,例如,java.util.Hashtable 提供的哈希表。
hashCode 的常规协定是:

在 Java 应用程序执行期间,在同一对象上多次调用 hashCode 方法时,必须一致地返回相同的整数,前提是对象上 equals 比较中所用的信息没有被修改。从某一应用程序的一次执行到同一应用程序的另一次执行,该整数无需保持一致。
如果根据 equals(Object) 方法,两个对象是相等的,那么在两个对象中的每个对象上调用 hashCode 方法都必须生成相同的整数结果。
以下情况不 是必需的:如果根据 equals(java.lang.Object) 方法,两个对象不相等,那么在两个对象中的任一对象上调用 hashCode 方法必定会生成不同的整数结果。但是,程序员应该知道,为不相等的对象生成不同整数结果可以提高哈希表的性能。
实际上,由 Object 类定义的 hashCode 方法确实会针对不同的对象返回不同的整数。(这一般是通过将该对象的内部地址转换成一个整数来实现的,但是 JavaTM 编程语言不需要这种实现技巧。)

返回:
此对象的一个哈希码值。
另请参见:
equals(java.lang.Object), Hashtable

--------------------------------------------------------------------------------

equals
public boolean equals(Object obj)
指示某个其他对象是否与此对象“相等”。
equals 方法在非空对象引用上实现相等关系:

自反性:对于任何非空引用值 x,x.equals(x) 都应返回 true。
对称性:对于任何非空引用值 x 和 y,当且仅当 y.equals(x) 返回 true 时,x.equals(y) 才应返回 true。
传递性:对于任何非空引用值 x、y 和 z,如果 x.equals(y) 返回 true,并且 y.equals(z) 返回 true,那么 x.equals(z) 应返回 true。
一致性:对于任何非空引用值 x 和 y,多次调用 x.equals(y) 始终返回 true 或始终返回 false,前提是对象上 equals 比较中所用的信息没有被修改。
对于任何非空引用值 x,x.equals(null) 都应返回 false。
Object 类的 equals 方法实现对象上差别可能性最大的相等关系;即,对于任何非空引用值 x 和 y,当且仅当 x 和 y 引用同一个对象时,此方法才返回 true(x == y 具有值 true)。

注意:当此方法被重写时,通常有必要重写 hashCode 方法,以维护 hashCode 方法的常规协定,该协定声明相等对象必须具有相等的哈希码。

本篇文章来源于:开发学院 http://edu.codepub.com   原文链接:http://edu.codepub.com/2009/1202/18394.php

posted @ 2012-06-05 00:20 abin 阅读(418) | 评论 (0)编辑 收藏

Java程序员面试中的多线程问题
http://sd.csdn.net/a/20120528/2806046.html 
java中thread的start()和run()有何区别?
http://zhidao.baidu.com/question/41360200.html
什么是ThreadLocal
http://www.cnblogs.com/cnblue/articles/2423756.html




posted @ 2012-06-04 22:36 abin 阅读(393) | 评论 (0)编辑 收藏

OSWorkflow是一个灵活的工作流引擎,设计成可嵌入到企业应用程序中。它提供了许多的持久化API支持包括:EJB,Hibernate,JDBC和其它。OSWorkflow还可以与Spring集成。
网址:http://www.opensymphony.com/osworkflow/

1.OSWorkflow基本概念(gigix)
http://gigix.blogdriver.com/gigix/113138.html
2.osworkflow中文指南(Quake Wang)
http://wiki.opensymphony.com/display/WF/Tutorial+-+Chinese
3.OSWorkflow入门(史帝芬心得笔记)
http://my.so-net.net.tw/idealist/OSWorkflow/
4.英文文档
http://wiki.opensymphony.com/display/WF/Manual
5.深入分析(银狐999)
http://blog.csdn.net/james999/category/52990.aspx


其它关于osworkflow的文章

http://captainandboat.spaces.live.com/blog/cns!9a3607f7808d2d0d!334.entry

http://qinysong.iteye.com/blog/post/333919

http://www.cnblogs.com/jssy/archive/2007/06/08/776175.html

http://zhusl.blog.sohu.com/32223382.html


posted @ 2012-06-03 23:16 abin 阅读(462) | 评论 (0)编辑 收藏

osworkflow.xml
<osworkflow>
 <persistence class="com.opensymphony.workflow.spi.memory.MemoryWorkflowStore" />
 <factory class="com.opensymphony.workflow.loader.XMLWorkflowFactory">
  <property key="resource" value="workflows.xml" />
 </factory>
</osworkflow>


workflows.xml
<workflows>
  <workflow name="docworkflow" type="resource" location="myworkflow.xml"/>
</workflows>


myworkflow.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE workflow PUBLIC "-//OpenSymphony Group//DTD OSWorkflow 2.6//EN" "http://www.opensymphony.com/osworkflow/workflow_2_8.dtd">
<workflow>
 <registers>
  <register type="class" variable-name="log">
   <arg name="class.name">com.opensymphony.workflow.util.LogRegister</arg>
   <arg name="addInstanceId">true</arg>
  </register>
 </registers>

 <initial-actions>
  <action id="100" name="Start Ordinary Workflow">
   <results>
    <unconditional-result old-status="Finished"
     status="Queued" step="1" />
   </results>
  </action>
  <action id="200" name="Start Emergent Workflow">
   <results>
    <unconditional-result old-status="Finished"
     status="Queued" step="5" />
   </results>
  </action>
 </initial-actions>

 <steps>

  <step id="1" name="Initiate Doc">
   <actions>
    <action id="1" name="Initial Work">
     <restrict-to>
      <conditions>
       <condition type="class">
        <arg name="class.name">
         com.opensymphony.workflow.util.StatusCondition
        </arg>
        <arg name="status">Queued</arg>
       </condition>
      </conditions>
     </restrict-to>
     <validators>
      <validator type="class">
       <arg name="class.name">
        org.abin.lee.validator.TitleValidator
       </arg>
      </validator>
     </validators>
     <pre-functions>
      <function type="class">
       <arg name="class.name">
        com.opensymphony.workflow.util.Caller
       </arg>
       <arg name="stepId">1</arg>
      </function>
      <function type="beanshell">
       <arg name="script">
        transientVars.get("log").info("Initiate Work");
       </arg>
      </function>
     </pre-functions>
     <results>
      <unconditional-result old-status="Finished"
       status="Prepared" step="1" owner="${caller}" />
     </results>
     <post-functions>
      <function type="beanshell">
       <arg name="script">
        propertySet.setString("title",
        (String)transientVars.get("title"));
       </arg>
      </function>
     </post-functions>
    </action>
    <action id="2" name="Deliver Work">
     <restrict-to>
      <conditions type="AND">
       <condition type="class">
        <arg name="class.name">
         com.opensymphony.workflow.util.StatusCondition
        </arg>
        <arg name="status">Prepared</arg>
        <arg name="stepId">1</arg>
       </condition>
       <condition type="class">
        <arg name="class.name">
         com.opensymphony.workflow.util.AllowOwnerOnlyCondition
        </arg>
       </condition>
      </conditions>
     </restrict-to>
     <pre-functions>
      <function type="beanshell">
       <arg name="script">
        transientVars.get("log").info("Deliver Doc to Boss A and B");
       </arg>
      </function>
     </pre-functions>
     <results>
      <unconditional-result old-status="Finished"
       status="Prepared" split="1" />
     </results>
    </action>
   </actions>
  </step>

  <step id="2" name="Review Doc In Boss A">
   <external-permissions>
    <permission name="permA">
     <restrict-to>
      <conditions type="AND">
       <condition name="check.status" type="class">
        <arg name="class.name">com.opensymphony.workflow.util.StatusCondition</arg>
        <arg name="status">Prepared</arg>
       </condition>
       <condition name="allow.owner.only" type="class">
        <arg name="class.name">com.opensymphony.workflow.util.AllowOwnerOnlyCondition</arg>
       </condition>
      </conditions>
     </restrict-to>
    </permission>
   </external-permissions>
   <actions>
    <action id="3" name="Review Work By A">
     <pre-functions>
      <function type="beanshell">
       <arg name="script">
        transientVars.get("log").info("Doc Reviewed By Boss A")
       </arg>
      </function>
     </pre-functions>
     <results>
      <unconditional-result old-status="Finished"
       status="Underway" join="1" />
     </results>
    </action>
   </actions>
  </step>

  <step id="3" name="Review Doc In Boss B">
   <external-permissions>
    <permission name="permA">
     <restrict-to>
      <conditions type="AND">
       <condition name="check.status" type="class">
        <arg name="class.name">com.opensymphony.workflow.util.StatusCondition</arg>
        <arg name="status">Prepared</arg>
       </condition>
       <condition name="allow.owner.only" type="class">
        <arg name="class.name">com.opensymphony.workflow.util.AllowOwnerOnlyCondition</arg>
       </condition>
      </conditions>
     </restrict-to>
    </permission>
   </external-permissions>
   <actions>
    <action id="4" name="Review Work By B">
     <pre-functions>
      <function type="beanshell">
       <arg name="script">
        transientVars.get("log").info("Doc Reviewed By Boss B")
       </arg>
      </function>
     </pre-functions>
     <results>
      <unconditional-result old-status="Finished"
       status="Underway" join="1" />
     </results>
    </action>
   </actions>
  </step>

  <step id="4" name="Finish Ordinary Work">
   <pre-functions>
    <function type="beanshell">
     <arg name="script">
      System.out.println("Finish Doc Review. \nTitle:"+propertySet.getString("title")+".");
     </arg>
    </function>
   </pre-functions>
  </step>

  <step id="5" name="Finish Emergent Work">
   <pre-functions>
    <function type="beanshell">
     <arg name="script">
      System.out.println("Emergency Handler");
     </arg>
    </function>
   </pre-functions>
  </step>

 </steps>

 <splits>
  <split id="1">
   <unconditional-result old-status="Finished"
    status="Prepared" step="2" />
   <unconditional-result old-status="Finished"
    status="Prepared" step="3" />
  </split>
 </splits>

 <joins>
  <join id="1">
   <conditions type="AND">
    <condition type="beanshell">
     <arg name="script"><![CDATA[ "Finished".equals(jn.getStep(2).getStatus()) && "Finished".equals(jn.getStep(3).getStatus()) ]]></arg>
    </condition>
   </conditions>
   <unconditional-result old-status="Finished"
    status="Reviewed" step="4" />
  </join>
 </joins>

</workflow>




TitleValidator.java

package org.abin.lee.validator;

import java.util.Map;
import com.opensymphony.module.propertyset.PropertySet;
import com.opensymphony.workflow.InvalidInputException;
import com.opensymphony.workflow.Validator;
import com.opensymphony.workflow.WorkflowException;

public class TitleValidator implements Validator {
 public void validate(Map transientVars, Map args, PropertySet ps)
   throws InvalidInputException, WorkflowException {
  System.out.println("TitleValidator is running");
  String title = (String) transientVars.get("title");
  if (title == null)
   throw new InvalidInputException("Missing title");
  if (title.length() > 30)
   throw new InvalidInputException("Title too long");
 }
}



SimpleSample.java

package org.abin.lee.workflow;

import java.util.HashMap;

import com.opensymphony.workflow.InvalidActionException;
import com.opensymphony.workflow.InvalidEntryStateException;
import com.opensymphony.workflow.InvalidInputException;
import com.opensymphony.workflow.InvalidRoleException;
import com.opensymphony.workflow.Workflow;
import com.opensymphony.workflow.WorkflowException;
import com.opensymphony.workflow.basic.BasicWorkflow;
import com.opensymphony.workflow.config.DefaultConfiguration;

public class SimpleSample {
 public static void main(String[] args) {
  try {
   Workflow workflow = new BasicWorkflow("abin");

   DefaultConfiguration config = new DefaultConfiguration();
   workflow.setConfiguration(config);

   long workflowId = workflow.initialize("docworkflow", 100, null);
   HashMap inputs = new HashMap();
   inputs.put("title", "openopen");

   workflow.doAction(workflowId, 1, inputs);

   workflow.doAction(workflowId, 2, null);

   workflow.doAction(workflowId, 3, null);

   workflow.doAction(workflowId, 4, null);
   
  } catch (InvalidActionException e) {
   System.out.println(e.getMessage());
  } catch (InvalidRoleException e) {
   System.out.println(e.getMessage());
  } catch (InvalidInputException e) {
   System.out.println(e.getMessage());
  } catch (InvalidEntryStateException e) {
   System.out.println(e.getMessage());
  } catch (WorkflowException e) {
   System.out.println(e.getMessage());
  }
 }
}




log4j.properties

log4j.rootCategory=info,log,console

log4j.logger.org.apache.axis2.enterprise=FATAL
log4j.logger.de.hunsicker.jalopy.io=FATAL
log4j.logger.httpclient.wire.header=FATAL
log4j.logger.org.apache.commons.httpclient=FATAL

log4j.appender.console=org.apache.log4j.ConsoleAppender
log4j.appender.console.layout=org.apache.log4j.PatternLayout
log4j.appender.console.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n
 
log4j.appender.log=org.apache.log4j.DailyRollingFileAppender
log4j.appender.log.File=logs/osworkflow.log
log4j.appender.log.layout=org.apache.log4j.PatternLayout
log4j.appender.log.layout.ConversionPattern=%d [%t] %-5p %c %x - %m%n




http://blog.sina.com.cn/s/blog_544a96ce0100nvjy.html

http://blog.csdn.net/tanruitian/article/details/498167

http://www.cnblogs.com/jacky73/archive/2008/12/17/1357134.html

posted @ 2012-06-03 22:39 abin 阅读(1539) | 评论 (2)编辑 收藏

CREATE TABLE `teacher` (
  `tid` int(11) NOT NULL AUTO_INCREMENT,
  `tname` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`tid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

 


CREATE TABLE `student` (
  `sid` int(11) NOT NULL AUTO_INCREMENT,
  `sname` varchar(100) DEFAULT NULL,
  `teacherid` int(11) DEFAULT NULL,
  PRIMARY KEY (`sid`),
  KEY `ftid` (`teacherid`),
  CONSTRAINT `ftid` FOREIGN KEY (`teacherid`) REFERENCES `teacher` (`tid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

 



package org.abin.lee.bean;

public class Student implements java.io.Serializable{
 
 private static final long serialVersionUID = 2664268794619785937L;
 private int sid;
 private String sname;
 private int teacherId;
 private Teacher teacher;
 
 public Student() {
 }

 public int getSid() {
  return sid;
 }

 public void setSid(int sid) {
  this.sid = sid;
 }

 public String getSname() {
  return sname;
 }

 public void setSname(String sname) {
  this.sname = sname;
 }

 public Teacher getTeacher() {
  return teacher;
 }

 public void setTeacher(Teacher teacher) {
  this.teacher = teacher;
 }

 public int getTeacherId() {
  return teacherId;
 }

 public void setTeacherId(int teacherId) {
  this.teacherId = teacherId;
 }
 
}





package org.abin.lee.bean;

import java.util.ArrayList;
import java.util.List;

public class Teacher implements java.io.Serializable{
 
 private static final long serialVersionUID = -7053173500969534203L;
 private int tid;
 private String tname;
 private List<Student> student=new ArrayList<Student>();
 
 public Teacher() {
 }
 
 public int getTid() {
  return tid;
 }
 public void setTid(int tid) {
  this.tid = tid;
 }
 public String getTname() {
  return tname;
 }
 public void setTname(String tname) {
  this.tname = tname;
 }

 public List<Student> getStudent() {
  return student;
 }

 public void setStudent(List<Student> student) {
  this.student = student;
 }

 
}





StudentMapper.xml(org.abin.lee.bean)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.abin.lee.dao.StudentDao">
  <parameterMap type="Student" id="parameterStudentMap">
    <parameter property="sid"/>
    <parameter property="sname"/>
    <parameter property="teacherId"/>
  </parameterMap>
   
  <insert id="insertStudent"    parameterMap="parameterStudentMap">
    <selectKey    keyProperty="sid" resultType="int" order="AFTER">
      SELECT LAST_INSERT_ID() AS ID
    </selectKey>
    INSERT INTO student(sname,teacherId)
    VALUES(#{sname},#{teacherId})
  </insert>   
   
  <resultMap type="Student" id="StudentMap">
    <result property="sid" column="sid"/>
    <result property="sname" column="sname"/>
    <result property="teacherId" column="teacherId"/>
    <association property="teacher" javaType="Teacher" column="teacherId" select="org.abin.lee.dao.TeacherDao.getTeacher"/>
  </resultMap>   
  <select id="getStudent" resultMap="StudentMap" parameterType="int">
    SELECT * FROM student
    WHERE sid=#{sid}
  </select>
   
  <select id="getStudentById" resultMap="StudentMap" parameterType="int">
    SELECT * FROM student
    WHERE teacherId=#{teacherId}
  </select>
 
 
</mapper>  



TeacherMapper.xml(org.abin.lee.bean)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.abin.lee.dao.TeacherDao">
  <parameterMap type="Teacher" id="parameterTeacherMap">
    <parameter property="tid"/>
    <parameter property="tname"/>
  </parameterMap>

  <insert id="insertTeacher" parameterMap="parameterTeacherMap">
    <selectKey    keyProperty="tid" resultType="int" order="AFTER">
      SELECT @@IDENTITY AS ID
    </selectKey>
    INSERT INTO teacher(tname)
    VALUES(#{tname})
  </insert>       
   
  <resultMap type="Teacher" id="resultTeacherMap">
    <result property="tid" column="tid"/>
    <result property="tname" column="tname"/>
    <collection property="student" column="sid" select="org.abin.lee.dao.StudentDao.getStudentById"/>
  </resultMap>
   
  <select id="getTeacher" resultMap="resultTeacherMap" parameterType="int">
    SELECT *
    FROM teacher
    WHERE tid=#{id}
  </select>         
  
</mapper>



package org.abin.lee.dao;

import java.util.List;

import org.abin.lee.bean.Student;

public interface StudentDao {
 void insertStudent(Student student);
 List<Student> getStudent(int id);
 List<Student> getStudentById(int teacherId);
}




package org.abin.lee.dao;

import org.abin.lee.bean.Teacher;

public interface TeacherDao {
 void insertTeacher(Teacher teacher);
 Teacher getTeacher(int id);
}





package org.abin.lee.dao.impl;

import java.util.List;

import org.abin.lee.bean.Student;
import org.abin.lee.dao.StudentDao;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

public class StudentDaoImpl extends HibernateDaoSupport implements StudentDao{

 public List<Student> getStudent(int id) {
  List<Student> list=null;
  String hql="select o from Student o where o.id="+id;
  try {
   list=(List<Student>)this.getHibernateTemplate().find(hql);
  } catch (Exception e) {
   e.printStackTrace();
  }
  return list;
 }

 public List<Student> getStudentById(int teacherId) {
  List<Student> list=null;
  String hql="select o from Student o where o.id="+teacherId;
  try {
   list=(List<Student>)this.getHibernateTemplate().find(hql);
  } catch (Exception e) {
   e.printStackTrace();
  }
  return list;
 }

 public void insertStudent(Student student) {
  try {
   this.getHibernateTemplate().save(student);
  } catch (Exception e) {
   e.printStackTrace();
  }
  
 }

}





package org.abin.lee.dao.impl;

import org.abin.lee.bean.Teacher;
import org.abin.lee.dao.TeacherDao;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

public class TeacherDaoImpl extends HibernateDaoSupport implements TeacherDao{

 public Teacher getTeacher(int id) {
  Teacher teacher=null;
  String hql="select o from Teacher o where o.id="+id;
  try {
   teacher=(Teacher)this.getHibernateTemplate().find(hql);
   this.getHibernateTemplate().flush();
  } catch (Exception e) {
   e.printStackTrace();
  }
  return teacher;
 }

 public void insertTeacher(Teacher teacher) {
  try {
   this.getHibernateTemplate().save(teacher);
   this.getHibernateTemplate().flush();
   
  } catch (Exception e) {
   e.printStackTrace();
  }
  
 }

}





package org.abin.lee.service;

import java.util.List;

import org.abin.lee.bean.Student;

public interface StudentService {
 
 void insertStudent(Student student);
 List<Student> getStudent(int id);
 List<Student> getStudentById(int teacherId);
 
}




package org.abin.lee.service;

import org.abin.lee.bean.Teacher;

public interface TeacherService {
 
 void insertTeacher(Teacher teacher);
 Teacher getTeacher(int id);
}




package org.abin.lee.service.impl;

import java.util.List;

import org.abin.lee.bean.Student;
import org.abin.lee.dao.StudentDao;
import org.abin.lee.service.StudentService;

public class StudentServiceImpl implements StudentService{
 private StudentDao studentDao;
 
 public List<Student> getStudent(int id) {
  return this.studentDao.getStudent(id);
 }

 public List<Student> getStudentById(int teacherId) {
  
  return this.studentDao.getStudentById(teacherId);
 }

 public void insertStudent(Student student) {
  this.studentDao.insertStudent(student);
  
 }

 public StudentDao getStudentDao() {
  return studentDao;
 }

 public void setStudentDao(StudentDao studentDao) {
  this.studentDao = studentDao;
 }

}




package org.abin.lee.service.impl;

import org.abin.lee.bean.Teacher;
import org.abin.lee.dao.TeacherDao;
import org.abin.lee.service.TeacherService;

public class TeacherServiceImpl implements TeacherService{
 private TeacherDao teacherDao;
 
 public Teacher getTeacher(int id) {
  
  return this.teacherDao.getTeacher(id);
 }

 public void insertTeacher(Teacher teacher) {
  this.teacherDao.insertTeacher(teacher);
  
 }

 public TeacherDao getTeacherDao() {
  return teacherDao;
 }

 public void setTeacherDao(TeacherDao teacherDao) {
  this.teacherDao = teacherDao;
 }
 
}





applicationContext-mapper.xml(org.abin.lee.spring)

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:context="http://www.springframework.org/schema/context"
 xmlns:aop="http://www.springframework.org/schema/aop"
 xmlns:tx="http://www.springframework.org/schema/tx"
 xsi:schemaLocation="
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
            http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

   <!--创建数据映射器,数据映射器必须为接口-->
 <bean id="studentDao"
  class="org.mybatis.spring.mapper.MapperFactoryBean">
  <property name="sqlSessionFactory" ref="sqlSessionFactory" />
  <property name="mapperInterface"
   value="org.abin.lee.dao.StudentDao" />
 </bean>
 
 <bean id="teacherDao"
  class="org.mybatis.spring.mapper.MapperFactoryBean">
  <property name="sqlSessionFactory" ref="sqlSessionFactory" />
  <property name="mapperInterface"
   value="org.abin.lee.dao.TeacherDao" />
 </bean>


</beans>






applicationContext-resource.xml(org.abin.lee.spring)

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:context="http://www.springframework.org/schema/context"
 xmlns:aop="http://www.springframework.org/schema/aop"
 xmlns:tx="http://www.springframework.org/schema/tx"
 xsi:schemaLocation="
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
            http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">


 <!--配置数据源 -->
 <bean id="dataSource"
  class="org.apache.commons.dbcp.BasicDataSource"
  destroy-method="close">
  <property name="driverClassName"
   value="com.mysql.jdbc.Driver">
  </property>
  <property name="url" value="jdbc:mysql://localhost:3306/abin"></property>
  <property name="username" value="root"></property>
  <property name="password" value=""></property>
  <property name="maxActive" value="100"></property>
  <property name="maxIdle" value="30"></property>
  <property name="maxWait" value="500"></property>
  <property name="defaultAutoCommit" value="true"></property>
 </bean>

    <!-- 创建SqlSessionFactory,同时指定数据源-->
 <bean id="sqlSessionFactory"
  class="org.mybatis.spring.SqlSessionFactoryBean">
  <property name="dataSource" ref="dataSource" />
  <property name="configLocation"
   value="classpath:mybatis-config.xml" />
 </bean>

 <bean id="transactionManager"
  class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  <property name="dataSource" ref="dataSource" />
 </bean>


</beans>







applicationContext-service.xml(org.abin.lee.spring)

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:context="http://www.springframework.org/schema/context"
 xmlns:aop="http://www.springframework.org/schema/aop"
 xmlns:tx="http://www.springframework.org/schema/tx"
 xsi:schemaLocation="
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
            http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">

 <bean id="studentService"
  class="org.abin.lee.service.impl.StudentServiceImpl">
  <property name="studentDao">
   <ref bean="studentDao" />
  </property>
 </bean>

 <bean id="teacherService"
  class="org.abin.lee.service.impl.TeacherServiceImpl">
  <property name="teacherDao">
   <ref bean="teacherDao" />
  </property>
 </bean>

</beans>





mybatis-config.xml(直接放在src目录下面)

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD  Config 3.0//EN"              
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>

 <settings>
  <!-- changes from the defaults for testing -->
  <setting name="cacheEnabled" value="false" />
  <setting name="useGeneratedKeys" value="true" />
  <setting name="defaultExecutorType" value="REUSE" />
 </settings>


 <typeAliases>
  <typeAlias type="org.abin.lee.bean.Student" alias="Student" />
  <typeAlias type="org.abin.lee.bean.Teacher" alias="Teacher" />
 </typeAliases>

 

 <mappers>
  <mapper resource="org/abin/lee/bean/StudentMapper.xml" />
  <mapper resource="org/abin/lee/bean/TeacherMapper.xml" />
 </mappers>


</configuration>





log4j.properties(直接放在src目录下面)

log4j.rootLogger=INFO,stdout,logfile
//log4j.rootLogger=INFO,logfile

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%-d{yyyy-MM-dd HH:mm:ss} [%c]-[%p] %m%n

log4j.appender.logfile=org.apache.log4j.RollingFileAppender
log4j.appender.logfile.File=../logs/contacts.log
log4j.appender.logfile.MaxFileSize=2048KB
log4j.appender.logfile.MaxBackupIndex=5
log4j.appender.logfile.layout=org.apache.log4j.PatternLayout
log4j.appender.logfile.layout.ConversionPattern=[%-5p] %d{yyyy-MM-dd HH:mm:ss} (%c) - %m%n

 





下面是测试代码:

package org.abin.lee.test;

import junit.framework.TestCase;

import org.abin.lee.bean.Student;
import org.abin.lee.bean.Teacher;
import org.abin.lee.service.StudentService;
import org.abin.lee.service.TeacherService;
import org.junit.Before;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestStudent extends TestCase{
 
 private StudentService studentService;
 private TeacherService teacherService;
 private ApplicationContext context;
 @Before
 public void setUp(){
  String[] xml=new String[3];
  xml[0]="org/abin/lee/spring/applicationContext-resource.xml";
  xml[1]="org/abin/lee/spring/applicationContext-mapper.xml";
  xml[2]="org/abin/lee/spring/applicationContext-service.xml";
  context=new ClassPathXmlApplicationContext(xml);
 }
 
 public void testStudent(){
  Teacher tea=new Teacher();
  tea.setTname("steven");
  teacherService=(TeacherService)context.getBean("teacherService");
  this.teacherService.insertTeacher(tea);
  Student stu=new Student();
  stu.setSname("john");
  stu.setTeacherId(tea.getTid());
  studentService=(StudentService)context.getBean("studentService");
  this.studentService.insertStudent(stu);
 }
 public StudentService getStudentService() {
  return studentService;
 }
 public void setStudentService(StudentService studentService) {
  this.studentService = studentService;
 }
 public TeacherService getTeacherService() {
  return teacherService;
 }
 public void setTeacherService(TeacherService teacherService) {
  this.teacherService = teacherService;
 }
 
}






package org.abin.lee.test;

import java.util.List;

import junit.framework.TestCase;

import org.abin.lee.bean.Student;
import org.abin.lee.bean.Teacher;
import org.abin.lee.service.StudentService;
import org.abin.lee.service.TeacherService;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestFind extends TestCase{
 private StudentService studentService;
 private TeacherService teacherService;
 private ApplicationContext context;
 @Before
 public void setUp(){
  String[] xml=new String[3];
  xml[0]="org/abin/lee/spring/applicationContext-resource.xml";
  xml[1]="org/abin/lee/spring/applicationContext-mapper.xml";
  xml[2]="org/abin/lee/spring/applicationContext-service.xml";
  context=new ClassPathXmlApplicationContext(xml);
 }
 @Test
 public void testFind(){
  teacherService=(TeacherService)context.getBean("teacherService");
  studentService=(StudentService)context.getBean("studentService");
  List<Student> list=this.studentService.getStudentById(4);
  Student stu=new Student();
  Teacher tea=new Teacher();
  for(int i=0;i<list.size();i++){
   System.out.println("666");
   stu=list.get(i);
   System.out.println("sid="+stu.getSid()+",sname="+stu.getSname()+",teacherid="+stu.getTeacherId());
   tea=stu.getTeacher();
   System.out.println("tid="+tea.getTid()+",tname="+tea.getTname());
  }
 }
 public StudentService getStudentService() {
  return studentService;
 }
 public void setStudentService(StudentService studentService) {
  this.studentService = studentService;
 }
 public TeacherService getTeacherService() {
  return teacherService;
 }
 public void setTeacherService(TeacherService teacherService) {
  this.teacherService = teacherService;
 }
 
}


posted @ 2012-06-03 18:36 abin 阅读(4259) | 评论 (0)编辑 收藏

1、运行调试常用命令

  • ./asterisk & #后台启动
  • ./asterisk -vvvc #启动asterisk 并尽量多的在后台显示调试信息
  • ./asterisk -r #连接asterisk控制台
  • set verbose #设置打印信息

2、asterisk控制台下常用命令

  • set reload #重新加载sip配置信息
  • sip set debug on #设置显示更多的Sip信息
  • sip set debug off #关闭更多sip信息显示
  • sip show channels #显示活动的sip通道
  • sip show peers #显示已定义的sip peer
  • dialplan show #显示拨号方案
  • dialplan reload #重新加载拨号方案
  • stop gracefully #优雅的终止asterisk
  • stop now #立即停止asterisk
  • module show #显示所有已加载模块
  • module load xxxxx.so #加载xxxxx.so 模块
  • module reload xxxx.so #重新加载xxxx.so
  • module unload xxxx.so #卸载xxxx.so模块
  • core show applications #显示所有的应用 如:Dial、Radius、Hangup、Answer等
  • core show channels #显示所有的通话频道
  • core show codecs #显示所有支持的编解码器
  • core show funcions #显示所有的功能函数
posted @ 2012-05-30 17:19 abin 阅读(2830) | 评论 (0)编辑 收藏

package org.abin.lee.file;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import junit.framework.TestCase;
import net.sf.json.JSONObject;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.protocol.HTTP;
import org.apache.http.util.EntityUtils;

public class QueryCustomerManagerTestCase extends TestCase {
 
 private static final String jsonServerUrl = "http://10.10.10.10:1010/portal/mobile/";
 
 static DefaultHttpClient client = new DefaultHttpClient();

 public static String sendReq(String method, String jsonReq)
   throws ClientProtocolException, IOException {
  HttpPost post = new HttpPost(jsonServerUrl + method);
  List<NameValuePair> nvps = new ArrayList<NameValuePair>();
  nvps.add(new BasicNameValuePair("json", jsonReq));

  post.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));

  HttpResponse response = client.execute(post);
  HttpEntity entity = response.getEntity();
  String entityStr = EntityUtils.toString(entity);

  return entityStr;
 }

 /**
  * 查询产品客户经理接口
  */
 public void testQueryCustomerManager() throws ClientProtocolException,
   IOException {
  String jsonReq = "{" + "RequestID:'11111',"+ "ProductID:'SC9904348'," + "timestamp:'20120416121200',"
    + "Hashcode:'1324546asdfgfhr65432wsdfgt654eds'" + "}";

  String resStr = this.sendReq("query-customer-manager-json!queryCustomerManager.action", jsonReq);

  System.out.println(resStr);

  assertNotNull(resStr);
//  JSONObject json = JSONObject.fromObject(resStr);
//  assertNotNull(json.get("requestID"));
 }

}

posted @ 2012-05-29 12:28 abin 阅读(1419) | 评论 (0)编辑 收藏

// 上传一般的参数
     public static String TestParam() throws HttpException, IOException {
     String url = "http://localhost:8080/IphoneTest/rece.do?method=receive";
     HttpClient client = new HttpClient();
     PostMethod postMethod = new PostMethod(url);
    
     // 填入各个表单域的值
     NameValuePair[] data = { new NameValuePair("username", "username"),
     new NameValuePair("passwd", "123456") };
     // 将表单的值放入postMethod中
     postMethod.setRequestBody(data);
     // 执行postMethod
     int status = client.executeMethod(postMethod);
     System.out.println(status + "--------状态------------");
     if (status!= HttpStatus.SC_OK) {
         System.out.println("--------fail-------");
     } else if (status== HttpStatus.SC_OK) {
         String str=postMethod.getResponseBodyAsString();
         System.out.println("---------服务器返回值---------:"+str);
     }
        return null;

     }


//上传带附件的参数:

public static String ParamFile() {
        String path = "D:\\KuGou\\b.txt";
        File file = new File(path);
        if (!file.exists()) {
            return "文件不存在!";
        }
        String url = "http://localhost:8080/IphoneTest/rece.do?method=receive";
        PostMethod filePost = new PostMethod(url);
        try {
            
            //FilePart:用来上传文件的类
            FilePart fp = new FilePart("file", file); //Part:类专门用来上传文件,其子类  ,FilePart:用来上传文件的类     StringPart:普通的文本参数
            System.out.println("---" + fp);
        
            fp.setContentType(MIME.getMIME(file.getName().substring(file.getName().lastIndexOf(".")+1)));
            
            //StringPart:普通的文本参数
            StringPart uname=new StringPart("username", "aa");            
            StringPart pass=new StringPart("password", "123456"); 

            Part[] parts = {uname,pass,fp}; 
            
           //对于MIME类型的请求,httpclient建议全用MulitPartRequestEntity进行包装
            MultipartRequestEntity mre=new MultipartRequestEntity(parts,filePost.getParams());
            
            filePost.setRequestEntity(mre);
            
            HttpClient client = new HttpClient();
            client.getHttpConnectionManager().getParams().setConnectionTimeout(50000);// 设置连接时间
            int status = client.executeMethod(filePost);
            System.out.println(status + "--------------");
            if (status != HttpStatus.SC_OK) {
                System.out.println(status + "--------------fail----");
            } else if (status == HttpStatus.SC_OK) {
                String str = "";            
                str = filePost.getResponseBodyAsString();
                System.out.println(filePost.getResponseBodyAsString()+ "---------服务器返回值---------");
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }


//同时上传几个附近

public static String ParamFiles() {
        String path = "D:\\KuGou\\b.txt";
        String path2 = "D:\\KuGou\\a.txt";
        File file = new File(path);
        File file2=new File(path2);
        if (!file.exists()) {
            return "文件不存在!";
        }
        if (!file2.exists()) {
            return "文件不存在!";
        }
        String url = "http://localhost:8080/IphoneTest/rece.do?method=receive";
        PostMethod filePost = new PostMethod(url);
        try {
            
            //FilePart:用来上传文件的类
            FilePart fp = new FilePart("file", file); //Part:类专门用来上传文件,其子类  ,FilePart:用来上传文件的类     StringPart:普通的文本参数
            FilePart fp2=new FilePart("file2", file2);
            System.out.println("---" + fp);
            fp.setContentType(MIME.getMIME(file.getName().substring(file.getName().lastIndexOf(".")+1)));
            
            //StringPart:普通的文本参数
            StringPart uname=new StringPart("username", "aa");            
            StringPart pass=new StringPart("password", "123456"); 
            Part[] parts = {uname,pass,fp,fp2}; 
            
            MultipartRequestEntity mre=new MultipartRequestEntity(parts,filePost.getParams());
            
            filePost.setRequestEntity(mre);
            
            HttpClient client = new HttpClient();
            client.getHttpConnectionManager().getParams().setConnectionTimeout(50000);// 设置连接时间
            int status = client.executeMethod(filePost);
            System.out.println(status + "--------------");
            if (status != HttpStatus.SC_OK) {
                System.out.println(status + "--------------fail----");
            } else if (status == HttpStatus.SC_OK) {
                String str = "";
                str = filePost.getResponseBodyAsString();
                System.out.println(filePost.getResponseBodyAsString()+ "---------服务器返回值---------");
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }


测试:

public static void main(String[] args) throws HttpException, IOException {
        // 上传一般的参数
        TestParam();

        ParamFile();
        
        ParamFiles();
    
    }



posted @ 2012-05-28 16:59 abin 阅读(6326) | 评论 (0)编辑 收藏

     摘要: 1、异常的优点      如果没有异常,在程序中,应当检查每个命令的成功还是失败,如   BEGIN   SELECT ...   -- check for ’no data found’ error   SELECT ...   -- check for ’no data foundR...  阅读全文
posted @ 2012-05-26 23:22 abin 阅读(1760) | 评论 (0)编辑 收藏

本文主要介绍Spring与Mybatis三种常用整合方法,需要的整合架包是mybatis-spring.jar,可通过链接
http://code.google.com/p/mybatis/下载到。

  1、采用数据映射器(MapperFactoryBean)的方式,不用写mybatis映射文件,采用注解方式提供相应的sql语句和输入参数。
  (1)Spring配置文件:

   <!-- 引入jdbc配置文件 -->      

 <context:property-placeholder location="jdbc.properties"/>          

 <!--创建jdbc数据源 -->        

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">         

 <property name="driverClassName" value="${driver}"/>        

  <property name="url" value="${url}"/>         

 <property name="username" value="${username}"/>         

 <property name="password" value="${password}"/>          

<property name="initialSize" value="${initialSize}"/>          

<property name="maxActive" value="${maxActive}"/>       

   <property name="maxIdle" value="${maxIdle}"/>          

<property name="minIdle" value="${minIdle}"/>       

 </bean>        

  <!-- 创建SqlSessionFactory,同时指定数据源-->       

 <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">        

 <property name="dataSource" ref="dataSource" />         

</bean>         

  <!--创建数据映射器,数据映射器必须为接口-->  

      <bean id="userMapper" class="org.mybatis.spring.mapper.MapperFactoryBean">        

 <property name="mapperInterface" value="com.xxt.ibatis.dbcp.dao.UserMapper" />       

  <property name="sqlSessionFactory" ref="sqlSessionFactory" />        

 </bean>         

 <bean id="userDaoImpl2" class="com.xxt.ibatis.dbcp.dao.impl.UserDaoImpl2">       

 <property name="userMapper" ref="userMapper"/>  

 </bean>  

 

数据映射器UserMapper,代码如下:

public interface UserMapper {     
    @Select("SELECT * FROM user WHERE id = #{userId}")        
  User getUser(@Param("userId"long id);   
 }  
 
 
dao接口类UserDao,代码如下:
Java代码
public interface UserDao {   
    public User getUserById(User user);  
 }  
 
dao实现类UserDaoImpl2,,代码如下:
Java代码
public class UserDaoImpl2 implements UserDao {   
     private UserMapper userMapper;      
     public void setUserMapper(UserMapper userMapper) {       
      this.userMapper = userMapper;      
   }         
   public User getUserById(User user) {      
     return userMapper.getUser(user.getId());      
   }  
  }  
 
 
2、采用接口org.apache.ibatis.session.SqlSession的实现类org.mybatis.spring.SqlSessionTemplate。
    mybatis中, sessionFactory可由SqlSessionFactoryBuilder.来创建。
MyBatis-Spring 中,使用了SqlSessionFactoryBean来替代。
SqlSessionFactoryBean有一个必须属性dataSource,
另外其还有一个通用属性configLocation(用来指定mybatis的xml配置文件路径)。
   (1)Spring配置文件:
<!-- 创建SqlSessionFactory,同时指定数据源-->  
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">     
 <property name="dataSource" ref="dataSource" />     
 <!-- 指定sqlMapConfig总配置文件,订制的environment在spring容器中不在生效-->   
 <property  name="configLocation"  value="classpath:sqlMapConfig.xml"/>   
 <!--指定实体类映射文件,可以指定同时指定某一包以及子包下面的所有配置文件,mapperLocations和configLocation有一个即可,当需要为实体类指定别名时,可指定configLocation属性,再在mybatis总配置文件中采用mapper引入实体类映射文件 -->  
  <!- - <property  name="mapperLocations"  value="classpath*:com/xxt/ibatis/dbcp/**/*.xml"/>  -->
 <bean>
  (2)mybatis总配置文件sqlMapConfig.xml:
<configuration>    
 <typeAliases>     
  <typeAlias type="com.xxt.ibatis.dbcp.domain.User" alias="User" />   
 </typeAliases>     
<mappers>      
  <mapper resource="com/xxt/ibatis/dbcp/domain/user.map.xml" />      
 </mappers>  
 </configuration> 
(3)实体类映射文件user.map.xml:
<mapper namespace="com.xxt.ibatis.dbcp.domain.User">       
 <resultMap type="User" id="userMap">         
  <id property="id" column="id" />        
   <result property="name" column="name" />        
   <result property="password" column="password" />      
     <result property="createTime" column="createtime" />     
   </resultMap>     
   <select id="getUser" parameterType="User" resultMap="userMap">     
     select * from user where id = #{id}        
</select>  
 <mapper/> 
 (4)dao层接口实现类UserDaoImpl:
Java代码
public class UserDaoImpl implements  UserDao  {  
    public SqlSessionTemplate sqlSession;    
      public User getUserById(User user) {     
     return (User)sqlSession.selectOne("com.xxt.ibatis.dbcp.domain.User.getUser", user); 
     }  
    public void setSqlSession(SqlSessionTemplate sqlSession) {       
    this.sqlSession = sqlSession;      }  
  }  
3、采用抽象类org.mybatis.spring.support.SqlSessionDaoSupport提供SqlSession。
   (1)spring配置文件:
Java代码
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">      
 <property name="dataSource" ref="dataSource" />     
 <property  name="configLocation"  value="classpath:sqlMapConfig.xml"/>     
 <!-- <property  name="mapperLocations"  value="classpath*:com/xxt/ibatis/dbcp/domain/user.map.xml"/   >  -->   
</bean>    
  <bean id="sqlSession"     class="org.mybatis.spring.SqlSessionTemplate">         
 <constructor-arg index="0" ref="sqlSessionFactory" />   
 </bean>    
 <bean id="userDaoImpl3" class="com.xxt.ibatis.dbcp.dao.impl.UserDaoImpl3">     
 <!--注入SqlSessionTemplate实例 -->      
<property name="sqlSessionTemplate" ref="sqlSession" />     
  <!--也可直接注入SqlSessionFactory实例,二者都指定时,SqlSessionFactory失效 -->     
 <!-- <property name="sqlSessionFactory" ref="sqlSessionFactory" />    -->  
 </bean>  
 
 (2) dao层接口实现类UserDaoImpl3:
   
Java代码
public class UserDaoImpl3 extends SqlSessionDaoSupport implements UserDao {  
   public User getUserById(User user) {     
   return (User) getSqlSession().selectOne("com.xxt.ibatis.dbcp.domain.User.getUser", user);     
  }  
 
posted @ 2012-05-25 13:53 abin 阅读(58262) | 评论 (1)编辑 收藏

仅列出标题
共50页: First 上一页 38 39 40 41 42 43 44 45 46 下一页 Last