- 浏览: 271769 次
文章分类
最新评论
-
yonghuuser:
< namespace > http://www. ...
使用 xfire 开发 web service 应用 -
悬空90:
牛人 呵呵
JCS 资料 -
悬空90:
谢谢分享 呵呵
JCS 应用 -
kuiye:
用于在客户端页面调用.
DWR util.js 整理(DWR 处理各种form表单Select/option,table等,List,Bean -
bo_hai:
好像不是原创呢!
抽象类与接口的区别
该树形结构是一颗关于地理信息的一颗树:
step 1、构建数据库(cteate_table_sql)
/*==============================================================*/
/* Table: DIM_GEOGRAPHY */
/*==============================================================*/
create table DIM_GEOGRAPHY (
ID integer not null,
GEOGRAPHY_CODE VARCHAR(32) not null,
GEOGRAPHY_NAME VARCHAR(32) not null,
GEOGRAPHY_NAME_EN VARCHAR(32) null,
GEOGRAPHY_LEVEL integer not null,
CITY_TYPE1 integer not null,
CITY_TYPE2 integer null,
GEO_TREE_CODE VARCHAR(32) null,
PARENT_GEOGRAPHY_ID VARCHAR(32) null,
USAGE_FLAG VARCHAR(2) not null,
CREATE_BY VARCHAR(32) not null,
CREATE_DATE VARCHAR(30) not null,
LASTUPDATE_BY VARCHAR(32) not null,
LASTUPDATE_DATE VARCHAR(30) not null,
constraint PK_DIM_GEOGRAPHY primary key (ID),
constraint FK_993 foreign key (CITY_TYPE2)
references DIM_DICT_ITEM (ID),
constraint FK_333 foreign key (CITY_TYPE1)
references DIM_DICT_ITEM (ID)
)
go
其中DIM_DICT_ITEM是一个数据字典表,存一些系统中常用数据,在这里存储城市类型。
step 2、构建Hibernate PO
/*========================================================================================*/
/* Bean: DimGeography */
/*========================================================================================*/
- /*
- * Created Mon Oct 16 14:07:33 CST 2006 by MyEclipse Hibernate Tool.
- */
- package com.fzfx88.po.base;
- import java.io.Serializable;
- import com.winchannel.base.service.GeographyService;
- /**
- * A class that represents a row in the 'DIM_GEOGRAPHY' table.
- * This class may be customized as it is never re-generated
- * after being created.
- */
- public class DimGeography
- extends AbstractDimGeography
- implements Serializable
- {
- /**
- * Simple constructor of DimGeography instances.
- */
- public DimGeography()
- {
- }
- /**
- * Constructor of DimGeography instances given a simple primary key.
- * @param id
- */
- public DimGeography(java.lang.Integer id)
- {
- super(id);
- }
- /* Add customized code below */
- private DimGeography country;
- private DimGeography province;
- private DimGeography city;
- private Integer countryId;
- private Integer provinceId;
- private Integer cityId;
- private String countryName;
- private String provinceName;
- private String cityName;
- public void getParents(){
- String treeCode = this.getGeoTreeCode();
- int i = treeCode.length()/3;
- GeographyService gService =new GeographyService();
- // if(i>=1){
- // country= gService.retrieveOrgByTreeCode(treeCode,1);
- // this.countryId = country.getId();
- // this.countryName =country.getGeographyName();
- // }
- if(i>=1){
- province= gService.retrieveOrgByTreeCode(treeCode,1);
- if(province!=null){
- this.provinceId = province.getId();
- this.provinceName =province.getGeographyName();
- }
- }
- if(i>=2){
- city= gService.retrieveOrgByTreeCode(treeCode,2);
- if(city !=null){
- this.cityId = city.getId();
- this.cityName =city.getGeographyName();
- }
- }
- }
- /**
- * @return Returns the cityId.
- */
- public Integer getCityId() {
- return cityId;
- }
- /**
- * @param cityId The cityId to set.
- */
- public void setCityId(Integer cityId) {
- this.cityId = cityId;
- }
- /**
- * @return Returns the cityName.
- */
- public String getCityName() {
- return cityName;
- }
- /**
- * @param cityName The cityName to set.
- */
- public void setCityName(String cityName) {
- this.cityName = cityName;
- }
- /**
- * @return Returns the countryId.
- */
- public Integer getCountryId() {
- return countryId;
- }
- /**
- * @param countryId The countryId to set.
- */
- public void setCountryId(Integer countryId) {
- this.countryId = countryId;
- }
- /**
- * @return Returns the countryName.
- */
- public String getCountryName() {
- return countryName;
- }
- /**
- * @param countryName The countryName to set.
- */
- public void setCountryName(String countryName) {
- this.countryName = countryName;
- }
- /**
- * @return Returns the provinceId.
- */
- public Integer getProvinceId() {
- return provinceId;
- }
- /**
- * @param provinceId The provinceId to set.
- */
- public void setProvinceId(Integer provinceId) {
- this.provinceId = provinceId;
- }
- /**
- * @return Returns the provinceName.
- */
- public String getProvinceName() {
- return provinceName;
- }
- /**
- * @param provinceName The provinceName to set.
- */
- public void setProvinceName(String provinceName) {
- this.provinceName = provinceName;
- }
- /**
- * @return Returns the city.
- */
- public DimGeography getCity() {
- return city;
- }
- /**
- * @param city The city to set.
- */
- public void setCity(DimGeography city) {
- this.city = city;
- }
- /**
- * @return Returns the country.
- */
- public DimGeography getCountry() {
- return country;
- }
- /**
- * @param country The country to set.
- */
- public void setCountry(DimGeography country) {
- this.country = country;
- }
- /**
- * @return Returns the province.
- */
- public DimGeography getProvince() {
- return province;
- }
- /**
- * @param province The province to set.
- */
- public void setProvince(DimGeography province) {
- this.province = province;
- }
- }
/*========================================================================================*/
/* Bean: AbstractDimGeography */
/*========================================================================================*/
- /*
- * WARNING: DO NOT EDIT THIS FILE. This is a generated file that is synchronized
- * by MyEclipse Hibernate tool integration.
- *
- * Created Mon Oct 16 14:07:33 CST 2006 by MyEclipse Hibernate Tool.
- */
- package com.fzfx88.po.base;
- import java.io.Serializable;
- /**
- * A class that represents a row in the DIM_GEOGRAPHY table.
- * You can customize the behavior of this class by editing the class, {@link DimGeography()}.
- * WARNING: DO NOT EDIT THIS FILE. This is a generated file that is synchronized
- * by MyEclipse Hibernate tool integration.
- */
- public abstract class AbstractDimGeography
- implements Serializable
- {
- /** The cached hash code value for this instance. Settting to 0 triggers re-calculation. */
- private int hashValue = 0;
- /** The composite primary key value. */
- private java.lang.Integer id;
- private java.util.Set childGeo;
- /** The value of the dimDistrSet one-to-many association. */
- private java.lang.String geoTreeCode;
- /** The value of the dimDistrSet one-to-many association. */
- private java.util.Set dimDistrSet;
- /** The value of the dimStoreSet one-to-many association. */
- private java.util.Set dimStoreSet;
- /** The value of the simple geographyCode property. */
- private java.lang.String geographyCode;
- /** The value of the simple geographyName property. */
- private java.lang.String geographyName;
- /** The value of the simple geographyNameEn property. */
- private java.lang.String geographyNameEn;
- /** The value of the simple geographyLevel property. */
- private java.lang.Integer geographyLevel;
- /** The value of the simple cityLevel property. */
- private DimDictItem cityType1;
- /** The value of the simple cityLevel property. */
- private DimDictItem cityType2;
- /** The value of the simple parentGeographyId property. */
- private java.lang.Integer parentGeographyId;
- /** The value of the simple usageFlag property. */
- private java.lang.String usageFlag;
- /** The value of the simple createBy property. */
- private java.lang.String createBy;
- /** The value of the simple createDate property. */
- private java.lang.String createDate;
- /** The value of the simple lastupdateBy property. */
- private java.lang.String lastupdateBy;
- /** The value of the simple lastupdateDate property. */
- private java.lang.String lastupdateDate;
- private Integer parentGeo;
- /**
- * Simple constructor of AbstractDimGeography instances.
- */
- public AbstractDimGeography()
- {
- }
- /**
- * Constructor of AbstractDimGeography instances given a simple primary key.
- * @param id
- */
- public AbstractDimGeography(java.lang.Integer id)
- {
- this.setId(id);
- }
- /**
- * Return the simple primary key value that identifies this object.
- * @return java.lang.Integer
- */
- public java.lang.Integer getId()
- {
- return id;
- }
- /**
- * Set the simple primary key value that identifies this object.
- * @param id
- */
- public void setId(java.lang.Integer id)
- {
- this.hashValue = 0;
- this.id = id;
- }
- /**
- * Return the value of the GEOGRAPHY_CODE column.
- * @return java.lang.String
- */
- public java.lang.String getGeographyCode()
- {
- return this.geographyCode;
- }
- /**
- * Set the value of the GEOGRAPHY_CODE column.
- * @param geographyCode
- */
- public void setGeographyCode(java.lang.String geographyCode)
- {
- this.geographyCode = geographyCode;
- }
- /**
- * Return the value of the GEOGRAPHY_NAME column.
- * @return java.lang.String
- */
- public java.lang.String getGeographyName()
- {
- return this.geographyName;
- }
- /**
- * Set the value of the GEOGRAPHY_NAME column.
- * @param geographyName
- */
- public void setGeographyName(java.lang.String geographyName)
- {
- this.geographyName = geographyName;
- }
- /**
- * Return the value of the GEOGRAPHY_LEVEL column.
- * @return java.lang.Integer
- */
- public java.lang.Integer getGeographyLevel()
- {
- return this.geographyLevel;
- }
- /**
- * Set the value of the GEOGRAPHY_LEVEL column.
- * @param geographyLevel
- */
- public void setGeographyLevel(java.lang.Integer geographyLevel)
- {
- this.geographyLevel = geographyLevel;
- }
- /**
- * Return the value of the CITY_LEVEL column.
- * @return java.lang.Integer
- */
- public DimDictItem getCityType1()
- {
- return this.cityType1;
- }
- /**
- * Set the value of the CITY_LEVEL column.
- * @param cityLevel
- */
- public void setCityType1(DimDictItem cityType1)
- {
- this.cityType1 = cityType1;
- }
- /**
- * Return the value of the PARENT_GEOGRAPHY_ID column.
- * @return java.lang.Integer
- */
- public java.lang.Integer getParentGeographyId()
- {
- return this.parentGeographyId;
- }
- /**
- * Set the value of the PARENT_GEOGRAPHY_ID column.
- * @param parentGeographyId
- */
- public void setParentGeographyId(java.lang.Integer parentGeographyId)
- {
- this.parentGeographyId = parentGeographyId;
- }
- /**
- * Return the value of the USAGE_FLAG column.
- * @return java.lang.String
- */
- public java.lang.String getUsageFlag()
- {
- return this.usageFlag;
- }
- /**
- * Set the value of the USAGE_FLAG column.
- * @param usageFlag
- */
- public void setUsageFlag(java.lang.String usageFlag)
- {
- this.usageFlag = usageFlag;
- }
- /**
- * Return the value of the CREATE_BY column.
- * @return java.lang.String
- */
- public java.lang.String getCreateBy()
- {
- return this.createBy;
- }
- /**
- * Set the value of the CREATE_BY column.
- * @param createBy
- */
- public void setCreateBy(java.lang.String createBy)
- {
- this.createBy = createBy;
- }
- /**
- * Return the value of the CREATE_DATE column.
- * @return java.lang.String
- */
- public java.lang.String getCreateDate()
- {
- return this.createDate;
- }
- /**
- * Set the value of the CREATE_DATE column.
- &
发表评论
-
正确使用 Volatile 变量
2008-05-21 11:30 1339Java™ 语言包含两种内在的同步机制:同步块(或方法)和 v ... -
构建一个更好的 HashMap
2008-05-21 10:47 1558ConcurrentHashMap 是 Doug Lea ... -
【Axis】简介信息
2007-09-14 17:43 1495Apache Axis 是Apache WebService项 ... -
抽象类与接口的区别
2007-08-23 00:17 37161abstract class和interface是Ja ... -
doGet()和doPost()的区别
2007-08-08 23:31 3278get只有一个流,参数附加在url后,地址行显示要传送的信息, ... -
面向对象的三个基本特征
2007-08-08 23:26 1835面向对象的三个基本特征是:封装、继承、多态。 封装 封装最好 ... -
java 树形结构设计(八) Struts + Hibernate ...
2007-06-04 17:08 2258step 12 : 构件树结构页面 GeogrophyLeft ... -
java 树形结构设计(七) Struts + Hibernate
2007-05-29 13:40 6074step 11、构建 树形结构类 java 代码 ... -
java 树形结构设计(六) Struts + Hibernate
2007-05-29 13:14 2565step 10、构造 树形结构类 java 代码 ... -
java 树形结构设计(五) Struts + Hibernate
2007-05-29 13:11 2537step 9 构造 树结构 类 java 代码 ... -
java 树形结构设计(四) Struts + Hibernate
2007-05-29 13:05 2158step 8: 数据访问类DAO java 代码 ... -
java 树形结构设计(三) Struts + Hibernate
2007-05-29 12:46 3146step 6、 Struts Action 类 jav ... -
java 树形结构设计(二) Struts + Hibernate
2007-05-29 11:52 3280step 3. Hibernate hbm xml 配置文件( ...
相关推荐
计算机毕业设计成品 JAVA JSP 车辆管理系统(struts+hibernate+spring+oracle) 计算机毕业设计成品 JAVA JSP 车辆管理系统(struts+hibernate+spring+oracle) 计算机毕业设计成品 JAVA JSP 车辆管理系统(struts+...
计算机毕业设计成品 JAVA JSP 车辆管理系统struts+hibernate+spring (源码+WORD文档) 计算机毕业设计成品 JAVA JSP 车辆管理系统struts+hibernate+spring (源码+WORD文档) 计算机毕业设计成品 JAVA JSP 车辆管理...
JAVA struts+hibernate实现的网络购物系统JAVA struts+hibernate实现的网络购物系统JAVA struts+hibernate实现的网络购物系统JAVA struts+hibernate实现的网络购物系统JAVA struts+hibernate实现的网络购物系统JAVA ...
AJAX实现用户登录注册(Struts+Spring+Hibernate+Ajax框架) AJAX实现用户登录注册(Struts+Spring+Hibernate+Ajax框架) AJAX实现用户登录注册(Struts+Spring+Hibernate+Ajax框架)
Struts+Hibernate+Spring+Eclipse已经成为轻量级开发J2EE的标准配置,被称为SHS经典组合,这也是目前Java程序员必须掌握的技能。由于使用范围广也使它们的版本更替非常之快,尤其是Java5推出以后这些项目都采用了...
本光盘是《整合Struts+Hibernate+Spring应用开发详解》一书的配书光盘,书中的代码按章存放, 即第二章所使用的代码放在codes文件夹的02文件夹下,依次类推。 本光盘根目录下有11个文件夹,其内容和含义说明如下: ...
车辆管理系统(struts+hibernate+spring+oracle).rar
一个spring+struts+hibernate的例子,是eclipse的工程,用tomcat5和mysql,文件夹下包含所有的源码和库,另外还有一个.sql的文件用于建立数据库。大家觉得它有什么不好,欢迎交流
王者归来之JAVA程序开发大全:基于MYECLIPSE平台+STRUTS+HIBERNATE+SPRING主体流框架开发.pdf MyEclipse使用最好的资源!
简单struts+spring+hibernate搭建,配置,适合初学者
《开发者突击:Java Web主流框架整合开发(J2EE+Struts+Hibernate+Spring)》详细介绍了Java Web软件架构中的各种开发技术。主要内容包括:以MySQL为数据库、Tomcat为Web服务器、Eclipse为开发工具、CVS为版本控制工具...
内包含struts2+hibernate最新版整合jar包++++++++++++++
因项目还在开发,所以本人只拿出一块单独的struts+hibernate增、删、改、查来演示,具体的一些包一看就知道; 项目直接在MyEclipse6.0运行,环境是里面自带的,用过的人都知道。本人测试没有问题。 具体的页面...
JSP源码——车辆管理系统(struts+hibernate+spring+oracle).zip
论坛系统项目(Struts 2+Hibernate+Spring实现)论坛系统项目(Struts 2+Hibernate+Spring实现)论坛系统项目(Struts 2+Hibernate+Spring实现)论坛系统项目(Struts 2+Hibernate+Spring实现)论坛系统项目(Struts...
利用jsp、struts、hibernate开发JavaWeb应用
这是一个基于struts+hibernate+spring的用户管理系统,通过hibernate实现数据持久化.
课程设计、毕业设计以及练手的优质java项目---网络购物系统(struts+hibernate) 课程设计、毕业设计以及练手的优质java项目---网络购物系统(struts+hibernate) 课程设计、毕业设计以及练手的优质java项目---网络...
MySQL数据库,完整备份
JAVA WEB整合开发实例精通:Struts+Hibernate+Spring