CRM_01集成spring和hibernate,拷贝jar文件拷贝相应的jar文件到/WEB-INF/lib目录下MySql的mysql-connector-java-3.1.13-bin.jarSpring的dist目录下的spring.jar文件Spring的lib\aspectj目录下的两个jar文件Hibernate的hibernate3.jar文件Hibernate的lib目录下的所有jar文件拷贝相应的配置文件到/WEB-INF目录下web.xml拷贝相应的配置文件到/src目录下Spring的配置文件applicationContext-*.xmlHibernate的配置文件hibernate.cfg.xml日志文件log4j.properties国际化资源文件MessageResources.properties了解DAO接口与业务逻辑接口设计之间的差异了解利用hibernate进行标准对象查询的基本方法(请参考CustomerDAO的hibernate实现类)Customer.java客户实体类packagecom.axjy.crm.model;/***@hibernate.classtable=T_Customer*@hibernate.discriminatorcolumn=customerCategorytype=string//单表继承*/publicclassCustomer{privateintid;privateStringname;privateStringshortName;//助记名称privateStringsn;//编号privateStringevaluation;//价值评估privateStringcreditRating;//信用等级privateStringtype;//客户类型privateStringindustry;//行业类别privateStringrelationRating;//关系等级privateStringsource;//客户来源privateStringcurrentStatus;//客户阶段privateCustomerparent;//父客户privateStringcountry;//国家privateStringphone;//电话privateStringprovince;//省份privateStringfax;//传真privateStringcity;//城市privateStringsite;//网站privateStringpostcode;//邮政编码privateStringaddress;//地址privateStringdescription;//备注privateDatecreateTime;//创建时间privateUserowner;//所有者publicStringgetAddress(){returnaddress;}publicvoidsetAddress(Stringaddress){this.address=address;}publicStringgetCity(){returncity;}publicvoidsetCity(Stringcity){this.city=city;}publicStringgetCountry(){returncountry;}publicvoidsetCountry(Stringcountry){this.country=country;}publicDategetCreateTime(){returncreateTime;}publicvoidsetCreateTime(DatecreateTime){this.createTime=createTime;}publicStringgetCreditRating(){returncreditRating;}publicvoidsetCreditRating(StringcreditRating){this.creditRating=creditRating;}publicStringgetCurrentStatus(){returncurrentStatus;}publicvoidsetCurrentStatus(StringcurrentStatus){this.currentStatus=currentStatus;}publicStringgetDescription(){returndescription;}publicvoidsetDescription(Stringdescription){this.description=description;}publicStringgetEvaluation(){returnevaluation;}publicvoidsetEvaluation(Stringevaluation){this.evaluation=evaluation;}publicStringgetFax(){returnfax;}publicvoidsetFax(Stringfax){this.fax=fax;}publicintgetId(){returnid;}publicvoidsetId(intid){this.id=id;}publicStringgetIndustry(){returnindustry;}publicvoidsetIndustry(Stringindustry){this.industry=industry;}publicStringgetName(){returnname;}publicvoidsetName(Stringname){this.name=name;}publicUsergetOwner(){returnowner;}publicvoidsetOwner(Userowner){this.owner=owner;}publicCustomergetParent(){returnparent;}publicvoidsetParent(Customerparent){this.parent=parent;}publicStringgetPhone(){returnphone;}publicvoidsetPhone(Stringphone){this.phone=phone;}publicStringgetPostcode(){returnpostcode;}publicvoidsetPostcode(Stringpostcode){this.postcode=postcode;}publicStringgetRelationRating(){returnrelationRating;}publicvoidsetRelationRating(StringrelationRating){this.relationRating=relationRating;}publicStringgetShortName(){returnshortName;}publicvoidsetShortName(StringshortName){this.shortName=shortName;}publicStringgetSite(){returnsite;}publicvoidsetSite(Stringsite){this.site=site;}publicStringgetSn(){returnsn;}publicvoidsetSn(Stringsn){this.sn=sn;}publicStringgetSource(){returnsource;}publicvoidsetSource(Stringsource){this.source=source;}publicStringgetType(){returntype;}publicvoidsetType(Stringtype){this.type=type;}publicStringgetProvince(){returnprovince;}publicvoidsetProvince(Stringprovince){this.province=province;}}CompanyCustomer.java公司客户packagecom.axjy.crm.model;/***@hibernate.subclass*/publicclassCompanyCustomerextendsCustomer{//单表继承privateStringemployeeSize;//人员规模publicStringgetEmployeeSize(){returnemployeeSize;}publicvoidsetEmployeeSize(StringemployeeSize){this.employeeSize=employeeSize;}}PersonalCustomer.java个人客户packagecom.axjy.crm.model;/***@hibernate.subclass*/publicclassPersonalCustomerextendsCustomer{//单表继承privateStringsex;//性别publicStringgetSex(){returnsex;}publicvoidsetSex(Stringsex){this.sex=sex;}}Customer.hbm.xmlhibernate-mappingclasstable=T_Customername=com.axjy.crm.model.Customeridname=idgeneratorclass=native//iddiscriminatortype=stringcolumn=customerCategory///指定区分客户类别的字段名称和类型propertyname=name/propertyname=shortName/propertyname=sn/propertyname=evaluation/propertyname=creditRating/propertyname=type/propertyname=industry/propertyname=relationRating/propertyname=source/propertyname=currentStatus/many-to-onename=parent/propertyname=country/propertyname=phone/propertyname=province/propertyname=fax/propertyname=city/propertyname=site/propertyname=postcode/propertyname=address/propertyname=description/propertyname=createTime/many-to-onename=owner/subclassname=com.axjy.crm.model.CompanyCustomer//公司客户时增加人员规模字段propertyname=employeeSize//subclasssubclassname=com.axjy.crm.model.PersonalCustomer//个人客户时增加性别字段propertyname=sex//subclass/class/hibernate-mappingContactPerson.java联系人实体类packagecom.axjy.crm.model;publicclassContactPerson{privateintid;pr