My Holder interface for bean and set management
来源:互联网 发布:万网域名转出需要多久 编辑:程序博客网 时间:2024/06/06 12:46
这是一个关键接口,用以彻底隔离数据访问层,业务逻辑层与输出输入表现层
/*
* Copyright ©2009 julewan, Inc.
* All Rights Reserved.
*/
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import core.Builder;
/**
* @author Hopenful
* @date 2009-5-28
*
* 所有的holder都实现相同的接口,以实现标准化操作
*
*
**/
public interface Holder <B>{
/**
* bean 有如integer,long,String等系统基本类型
* 也有常见的如user,role,work,item等业务类型
* 这个判断是用以区分这二者的,因为二者的处理方式将完全相反
* @return
*/
public boolean isEntityHolder();
/**
* 返回被管理的类型
* 如果功能够强大的话,其实可以借助继承与泛型的力量来做
* 但是目前这样做代价太大了
* @return
*/
public Class<B> getBeanType();
/**
* 如果是entity,则一般来说是有主键的
* @return
*/
public String[] getKeys();
/**
* 返回entity的所有属性
* @return
*/
public String[] getProperties();
/**
* 返回entity属性的类型
* @param property
* @return
*/
public Class<?> getPropertyType(String property);
/**
* 从字符串反序列化为对象,这是为restful view做准备的
* @param str
* @return
*/
public B fromString(String str);
/**
* 将对象序列化为字符串,这是为restful view做准备的
* @param b
* @return
*/
public String toString(B b);
/**
* new 一个新对象,然后放入session中
* @return
*/
public B create();
/**
* 根据主键获取一个对象
* 如果没有给出主键,则从session中获取那个新bean
* @param keys
* @return
*/
public B get(final Object ... keys);
/**
* 即使是简单的,也必须装入一个Set中,这样为性能优化留下空间!
* @param set
* @param setArgs
* @return
*/
public List<B> find(final Bean.Set<B> set, final Object...setArgs);
/**
* 返回对Set由给定计算方式的转换后的结果
*
* @param <RESULT>
* @param builder
* @param set
* @param setArgs
* @return
*/
public <RESULT> RESULT fetch(final Builder<Collection<B>, RESULT> builder, final Bean.Set<B> set, final Object...setArgs);
/**
* 保存, 统一了insert和update方法
* @param it
*/
public void save(final Iterator<B> it);
/**
* 保存
* 如果没有参数,则表示将Session中new bean保存下来
* @param b
*/
public void save(final B ... b);
/**
* 批量保存
* @param set
* @param propertyValueMap
* @param setArgs
*/
public void save(final Bean.Set<B> set, final Map<String, Object> propertyValueMap, final Object...setArgs);
/**
* 批量保存,
* 这个方法只是将propertyValueMap用String[]与args对应的方法表现出来,
* 也就是说propertyValuesAndSetArgs的前properties.length个参数实际上是对应的propertyValue.
* @param set
* @param properties
* @param propertyValuesAndSetArgs
*/
public void save(final Bean.Set<B> set, final String[] properties, final Object...propertyValuesAndSetArgs);
/**
* 删除
* @param it
*/
public void remove(final Iterator<B> it);
/**
* 删除
* 如果没有参数,则为删除session中的new beans
* @param b
*/
public void remove(final B ... b);
/**
* 批量删除
* 如果Set是ALL,则就是clear all
* @param set
* @param setArgs
*/
public void remove(final Bean.Set<B> set, final Object...setArgs);
}
- My Holder interface for bean and set management
- Power Management interface for Solaris device driver
- Power Management Interface for System Sleep
- Security Information Management and Security Event Management for Compliance
- Effective Databases For Text And Document Management
- 11 SDS and Storage Management for Containers
- Explaination for Class, Abstract Class and Interface
- for my life value and my dream to work hard ,
- C.Interface.And.Implementations—set的实现
- differences between List and Set interface in point format
- BlueROV-3: Fathom-S Tether Interface Board Set and Batteries
- Create Vlan for Interface for Ubuntu and Fedore
- Visualizing Project Management : Models and Frameworks for Mastering Complex Systems
- Data Mining Techniques : For Marketing, Sales, and Customer Relationship Management
- Storage Virtualization : Technologies for Simplifying Data Storage and Management
- Content and Workflow Management for Library Websites: Case Studies
- Database Modeling for Industrial Data Management: Emerging Technologies and Applications
- offline installing deb for ubuntu and deb management
- Homework-电子商务发展存在的问题
- AT&T提前行动 美国两大移动巨头展开4G大战
- 让IE和Firefox都支持innerText(textContent )
- 我的第一篇日志
- 2009.5.30 OA 项目组一周工作报告
- My Holder interface for bean and set management
- 话说程序员的职业生涯
- 关于Struts问题,大家帮忙啊
- Linux 入门常用命令 — 文件的复制、删除和移动
- Linux 入门常用命令 — 目录的创建与删除
- Linux 入门常用命令 — 文本处理
- 好友选择器V2.0--基于Jquery
- Linux 入门常用命令 — 备份与压缩
- Linux 入门常用命令 — 改变文件或目录的访问权限