📄 dictypeserviceimpl.java
字号:
package com.chinatelecom.service.impl;
import java.util.List;
import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import com.chinatelecom.mode.TDicType;
import com.chinatelecom.service.IDicTypeService;
/**
* 字典类型的管理
*
* @author 王晓翠
*
*/
public class DicTypeServiceImpl extends HibernateDaoSupport implements IDicTypeService {
/**
* 新增字典类型
*/
public void addType(TDicType dicType) {
// TODO Auto-generated method stub
this.getHibernateTemplate().save(dicType);
}
/**
* deleteType方法
* 删除字典类型
*
* 2009-3-24 1:20
*
* 作者:王晓翠
*/
public void deleteType(String[] str) {
// TODO Auto-generated method stub
for(int i = 0;i < str.length;i ++){
HibernateTemplate ht = this.getHibernateTemplate();
TDicType type = (TDicType)ht.get(TDicType.class, Long.parseLong(str[i]));
ht.delete(type);
}
}
/**
* 查找字典类型列表
*/
public List findTypeList() {
// TODO Auto-generated method stub
return this.getHibernateTemplate().find("from TDicType");
}
/**
* 更新字典类型
*/
public void updateType(TDicType dicType) {
// TODO Auto-generated method stub
HibernateTemplate ht = this.getHibernateTemplate();
ht.update(dicType);
}
/**
* 通过id来查找字典类型
*/
public TDicType findTypeById(long typeId) {
// TODO Auto-generated method stub
HibernateTemplate ht = this.getHibernateTemplate();
TDicType type = (TDicType)ht.get(TDicType.class, typeId);
return type;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -