97 Star 114 Fork 3

知启蒙 / zhiqim_orm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MulanPSL-2.0

什么是“知启蒙数据库映射”?


      “知启蒙数据库映射(ZhiqimORM)”是Zhiqim Development Kit面向数据库开发的多例服务,包括ZSQL规范和三大映射关系(表映射、字段映射和指令映射),有比MyBatis更简单的动态SQL,和比Hibernate更彻底的对象关系映射:
1、数据库二维表和Java对象之间的注解定义映射,表和视图分别对应Java的_Table、_View;
2、数据库表列和Java字段的数据格式映射,支持6种数据库的9种数据格式;
3、数据库SQL语句和Java指令映射,基于ZTable、ZView的创建、清空、存在、分页、列表、单条、数目、求和、插入、更新、替换、删除等指令。


知启蒙数据库映射有哪些优点?


1、ZhiqimORM仅依赖JDK1.7+和ZhiqimKernel。15年的坚持,值得信赖。
2、ZhiqimORM是基于ZhiqimKernel设计的多例服务,支持配置多个数据库,且自带JDBC连接池。
3、ZhiqimORM的ZSQL语句可以通过XML配置,和Java代码分离,更易查看和检查,支持不同后缀适配不同的数据库;
4、ZhiqimORM的ZSQL/ZDBO规范通过(?、##、$$)三个通配符建立SQL语句和Java对象的映射关联,简洁清晰。
5、ZhiqimORM提供了标准的ZTable规则,对应数据库表设计,大量的基于表的增、删、改、查、列表、分页、统计无需编写SQL语句;
6、ZhiqimORM提供了标签的ZTView规则,对应多表关联设计,大量基于视图的查询、列表、分页和统计无需编写SQL语句。


知启蒙数据库映射目前支持的6种数据库


编号 数据库名称 常用的驱动 连接URL
1 mysql com.mysql.jdbc.Driver jdbc:mysql://127.0.0.1:3306/zhiqim?useUnicode=true&characterEncoding=UTF-8
2 oracle oracle.jdbc.driver.OracleDriver jdbc:oracle:thin:@127.0.0.1:1521:zhiqim
3 mssql com.microsoft.jdbc.sqlserver.SQLServerDriver jdbc:microsoft:sqlserver://127.0.0.1:1433;DatabaseName=zhiqim
4 postpresql org.postgresql.Driver jdbc:postgresql://127.0.0.1:5432/zhiqim
5 sqlite org.sqlite.JDBC jdbc:sqlite:./db/zhiqim.db
6 hsql org.hsqldb.jdbc.JDBCDriver jdbc:hsqldb:./db/zhiqim

知启蒙数据库映射支持的9种数据格式映射


编号 名称 JAVA类型 MySQL Oracle MSSQL PostpreSQL SQLite HSQL
基本类型5种
1 boolean boolean tinyint(1) NUMBER(1) bit bool integer boolean
2 byte int tinyint(4) NUMBER(4) tinyint int2 integer tinyint
3 short int smallint(6) NUMBER(6) smallint int2 integer smalli
nt
4 int int int NUMBER(11) int int4 integer integer
5 long long bigint NUMBER(20) bigint int8 integer bigint
对象类型2种
6 string java.lang.
String
varchar
char
text
mediumtext
longtext
VARCHAR2
CHAR
CLOB
varchar
char
text
varchar
char
text
varchar
char
text
varchar
char
clob
7 datetime java.sql.
Timestamp
datetime DATE datetime timestamp datetime timestamp
特殊类型2种
8 decimal double decimal(m,n) NUMBER(m,n) decimal(m,n) decimal(m,n) numeric(m,n) decimal
(m,n)
9 binary byte[] mediumblob BLOB image bytea blob blob

知启蒙数据库映射使用举例                                                                                       下载留言本示例

/**
 * 首页
 *
 * @version v1.0.0 @author zouzhigang 2016-9-1 新建与整理
 */
public class IndexAction implements Action
{
    @Override
    public void execute(HttpRequest request) throws Exception
    {
        int page = request.getParameterInt("page", 1);
        int pageSize = request.getContextAttributeInt("page.size", 10);
        
        Selector selector = new Selector();
        selector.addOrderbyDesc("messageTime");
        PageResult<Message> result = Global.get(ZTable.class).page(Message.class, page, pageSize, selector);
         
        request.setAttribute("result", result);
    }
}

知启蒙数据库映射指令集

    /********************************************************************************************/
    //exist 表是否存在
    /********************************************************************************************/
    
    /**
     * 是否存在[表类]对应的[实际表]
     * 
     * @param clazz         表类
     * @return              =true表示存在,=false表示不存在
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public boolean exist(Class<?> clazz) throws ORMException, SQLException;

    /**
     * 是否存在[表类]对应的[实际表]月表,支持表名中替换字段指定为$MONTH$,如LOG_TRACE$MONTH$
     * 
     * @param clazz         表类
     * @param month         月份
     * @return              =true表示存在,=false表示不存在
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public boolean existMonth(Class<?> clazz, String month) throws ORMException, SQLException;
    
    /**
     * 是否存在[表类]对应的[实际表],支持表名中有一个替换字段,如LOG_TRACE$ID$
     * 
     * @param clazz         表类
     * @param replaceKey    替换键
     * @param replaceValue  替换值
     * @return              =true表示存在,=false表示不存在
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public boolean exist(Class<?> clazz, String replaceKey, String replaceValue) throws ORMException, SQLException;
    
    /**
     * 是否存在[表类]对应的[实际表]可替换表,支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$
     * 
     * @param clazz         表类
     * @param replaceMap    可替换字段表
     * @return              =true表示存在,=false表示不存在
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public boolean exist(Class<?> clazz, MapSS replaceMap) throws ORMException, SQLException;

    /********************************************************************************************/
    //create 创建表
    /********************************************************************************************/
    
    /**
     * 创建[表类]对应的[实际表]
     * 
     * @param clazz         表类
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public void create(Class<?> clazz) throws ORMException, SQLException;
    
    /**
     * 创建[表类]对应的[实际表]月表
     * 
     * @param clazz         表类
     * @param month         月份
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public void createMonth(Class<?> clazz, String month) throws ORMException, SQLException;
    
    /**
     * 创建[表类]对应的[实际表]可替换表,支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$
     * 
     * @param clazz         表类
     * @param replaceMap    可替换字段表
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public void create(Class<?> clazz, MapSS replaceMap) throws ORMException, SQLException;
    
    /********************************************************************************************/
    //truncate 清空表
    /********************************************************************************************/
    
    /**
     * 清空[表类]对应的[实际表]
     * 
     * @param clazz         表类
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public void truncate(Class<?> clazz) throws ORMException, SQLException;
    
    /**
     * 清空[表类]对应的[实际表],支持表名中替换字段指定为$MONTH$,如LOG_TRACE$MONTH$
     * 
     * @param clazz         表类
     * @param month         分月表时使用
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public void truncateMonth(Class<?> clazz, String month) throws ORMException, SQLException;
    
    /**
     * 清空[表类]对应的[实际表],支持表名中有一个替换字段,如LOG_TRACE$ID$
     * 
     * @param clazz         表类
     * @param replaceKey    替换键
     * @param replaceValue  替换值
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public void truncate(Class<?> clazz, String replaceKey, String replaceValue) throws ORMException, SQLException;

    /**
     * 清空[表类]对应的[实际表],支持表名中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$
     * 
     * @param clazz         表类
     * @param replaceMap    替换表
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public void truncate(Class<?> clazz, MapSS replaceMap) throws ORMException, SQLException;
    
    /********************************************************************************************/
    //insert 插入数据
    /********************************************************************************************/
    
    /**
     * 增加数据,传入标准[表类]对象
     * 
     * @param data          表对象
     * @return int          表示插入的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int insert(Object data) throws ORMException, SQLException;

    /**
     * 增加数据,支持表名中替换字段指定为$MONTH$,如LOG_TRACE$MONTH$
     * 
     * @param data          表类
     * @param month         月份
     * @return              int 表示插入的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int insertMonth(Object data, String month) throws ORMException, SQLException;
    
    /**
     * 增加数据,支持表或字段中有一个替换字段,如LOG_TRACE$ID$
     * 
     * @param data          表对象
     * @param replaceKey    替换键
     * @param replaceValue  替换值
     * @return              int 表示插入的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int insert(Object data, String replaceKey, String replaceValue) throws ORMException, SQLException;
    
    /**
     * 增加数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$
     * 
     * @param data          表对象
     * @param replaceMap    适配表
     * @return              int 表示插入的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int insert(Object data, MapSS replaceMap) throws ORMException, SQLException;
    
    /**
     * 替换数据,传入标准[表类]对象和更新器(取fieldMap和replaceMap)当存在时指定修改的值
     * 
     * @param data          表对象
     * @param updater       更新器
     * @return              int 表示插入的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int insertOrUpdate(Object data, Updater updater) throws ORMException, SQLException;
    
    /**
     * 批量增加数据
     * 
     * @param dataList      表对象列表
     * @return              int 表示插入的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int[] insertBatch(List<?> dataList) throws ORMException, SQLException;
    
    /**
     * 批量增加数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$
     * 
     * @param dataList      表对象列表
     * @param replaceMap    适配表
     * @return              int 表示插入的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int[] insertBatch(List<?> dataList, MapSS replaceMap) throws ORMException, SQLException;
    
    /********************************************************************************************/
    //replace 替换数据,MYSQL支持,如果有数据先删除后增加
    /********************************************************************************************/
    
    /**
     * 替换数据,传入标准[表类]对象
     * 
     * @param data          表对象
     * @return              int 表示插入的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int replace(Object data) throws ORMException, SQLException;

    /**
     * 替换数据,支持表名中替换字段指定为$MONTH$,如LOG_TRACE$MONTH$
     * 
     * @param data          表对象
     * @param month         月份
     * @return int          表示插入的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int replaceMonth(Object data, String month) throws ORMException, SQLException;
    
    /**
     * 替换数据,支持表或字段中有一个替换字段,如LOG_TRACE$ID$
     * 
     * @param data          表对象
     * @param replaceKey    替换键
     * @param replaceValue  替换值
     * @return              int 表示插入的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int replace(Object data, String replaceKey, String replaceValue) throws ORMException, SQLException;
    
    /**
     * 替换数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$
     * 
     * @param data          表对象
     * @param replaceMap    适配表
     * @return              int 表示插入的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int replace(Object data, MapSS replaceMap) throws ORMException, SQLException;

    /**
     * 批量替换数据
     * 
     * @param dataList      表对象列表
     * @return              int 表示插入的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int[] replaceBatch(List<?> dataList) throws ORMException, SQLException;
    
    /**
     * 批量替换数据,支持表或字段中中有多个替换字段,如LOG_TRACE_$MONTH$_$ID$
     * 
     * @param dataList      表对象列表
     * @param replaceMap    适配表
     * @return              int 表示插入的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int[] replaceBatch(List<?> dataList, MapSS replaceMap) throws ORMException, SQLException;
    
    /********************************************************************************************/
    //update 更新数据
    /********************************************************************************************/
    
    /**
     * 更新数据,指定更新器需要更新的字段、条件和可替换表
     * 
     * @param clazz         表类
     * @param updater       更新器
     * @return              int 表示更新的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int update(Class<?> clazz, Updater updater) throws ORMException, SQLException;
    
    /**
     * 更新数据,指定对象,根据主键进行更新,主键值不更新
     * 
     * @param data          表对象
     * @return              int 表示更新的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int update(Object data) throws ORMException, SQLException;
    
    /**
     * 更新数据,指定对象,根据主键进行更新,主键值不更新,支持表名中替换字段指定为$MONTH$,如LOG_TRACE$MONTH$
     * 
     * @param data          表对象
     * @param month         月份
     * @return              int 表示更新的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int updateMonth(Object data, String month) throws ORMException, SQLException;
    
    /**
     * 更新数据,指定对象,根据主键进行更新,主键值不更新,支持表或字段中有一个替换字段,如LOG_TRACE$ID$
     * 
     * @param data          表对象
     * @param replaceKey    替换键
     * @param replaceValue  替换值
     * @return              int 表示更新的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int update(Object data, String replaceKey, String replaceValue) throws ORMException, SQLException;
    
    /**
     * 更新数据,指定对象,根据主键进行更新,主键值不更新,支持可替换表
     * 
     * @param data          表对象
     * @param replaceMap    适配表
     * @return              int 表示更新的条数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int update(Object data, MapSS replaceMap) throws ORMException, SQLException;
    
    /********************************************************************************************/
    //delete 删除数据
    /********************************************************************************************/
    
    /**
     * 删除数据,多个主键时使用
     * 
     * @param clazz         表类
     * @param ids           关键属性为数组,多个主键
     * @return              返回删除数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int delete(Class<?> clazz, Object... ids) throws ORMException, SQLException;
    
    /**
     * 删除数据, 根据条件
     * 
     * @param clazz         表类
     * @param selector      对象选择器
     * @return              返回删除数
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int delete(Class<?> clazz, Selector selector) throws ORMException, SQLException;
    
    /********************************************************************************************/
    //count 查询数目
    /********************************************************************************************/
    
    /**
     * 查询数目,多个主键时使用
     * 
     * @param clazz         表类
     * @param ids           关键属性值,支持多个
     * @return              存在的数目
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int count(Class<?> clazz, Object... ids) throws ORMException, SQLException;

    /**
     * 查询数目,整表查询
     * 
     * @param clazz         表类
     * @return              int 数目值
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int count(Class<?> clazz) throws ORMException, SQLException;
    
    /**
     * 查询数目,根据条件、可替换表查询
     * 
     * @param clazz         表类
     * @param selector      对象查询器
     * @return              int 数目值
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public int count(Class<?> clazz, Selector selector)throws ORMException, SQLException;
    
    /********************************************************************************************/
    //sum 计算总和
    /********************************************************************************************/
    
    /**
     * 计算总和
     * 
     * @param clazz         表类
     * @param field         表字段
     * @return              计算总和
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public long sum(Class<?> clazz, String field) throws ORMException, SQLException;
    
    /**
     * 计算总和
     * 
     * @param clazz         表类
     * @param selector      对象查询器
     * @param field         表字段
     * @return              计算总和
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public long sum(Class<?> clazz, Selector selector, String field) throws ORMException, SQLException;
    
    /**
     * 计算多个总和
     * 
     * @param clazz         表类
     * @param selector      对象查询器
     * @param fields        多个表字段
     * @return              计算多个总和
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public long[] sum(Class<?> clazz, Selector selector, String... fields) throws ORMException, SQLException;
    
    /********************************************************************************************/
    //item 查询一条数据
    /********************************************************************************************/
    
    /**
     * 查询一个表对象,支持多个主键
     * 
     * @param clazz         表类
     * @param ids           关键属性值
     * @return              返回表对象
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public <T> T item(Class<T> clazz, Object... ids) throws ORMException, SQLException;
    
    /**
     * 查询一个表对象,并指定返回属性,查询第一行
     * 
     * @param clazz         表类
     * @return              返回表对象
     * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常
     * @throws SQLException 数据库异常
     */
    public <T> T item(Class<T> clazz) throws ORMException, SQLException;
    
    /**
     * 查询一个表对象,并指定返回属性,查询条件和排序条件
     * 
     * @param clazz         表类
     * @param selector      对象查询器
     * @return              返回表对象
     * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常
     * @throws SQLException 数据库异常
     */
    public <T> T item(Class<T> clazz, Selector selector) throws ORMException, SQLException;
    
    /********************************************************************************************/
    //list 查询列表
    /********************************************************************************************/
    
    /**
     * 查询表对象列表,全表查询
     * 
     * @param clazz         表类
     * @return              返回表对象列表
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public <T> List<T> list(Class<T> clazz) throws ORMException, SQLException;
    
    /**
     * 查询表对象列表,并指定返回属性,查询条件和排序条件
     * 
     * @param clazz         表类
     * @param selector      对象查询器
     * @return              返回表对象列表
     * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常
     * @throws SQLException 数据库异常
     */
    public <T> List<T> list(Class<T> clazz, Selector selector) throws ORMException, SQLException;
    
    /**
     * 查询表对象列表,查询指定的位置的数据
     * 
     * @param clazz         表类
     * @param pageNo        页码
     * @param pageSize      页数
     * @return              返回表对象列表
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public <T> List<T> list(Class<T> clazz, int pageNo, int pageSize) throws ORMException, SQLException;
    
    /**
     * 查询表对象列表,并指定位置的,条件和排序条件
     * 
     * @param clazz         表类
     * @param pageNo        页码
     * @param pageSize      页数
     * @param selector      对象查询器
     * @return              返回表对象列表
     * @throws ORMException 映射异常,如果传入的属性不在配置文件中则异常
     * @throws SQLException 数据库异常
     */
    public <T> List<T> list(Class<T> clazz, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException;
    
    /********************************************************************************************/
    //page 分页显示
    /********************************************************************************************/
    
    /**
     * 查询表对象分页信息
     * 
     * @param clazz         表类
     * @param pageNo        页码
     * @param pageSize      页数
     * @return              分页信息,包括总页数,页码,页数和查询的记录
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public <T> PageResult<T> page(Class<T> clazz, int pageNo, int pageSize) throws ORMException, SQLException;

    /**
     * 查询表对象分页信息
     * 
     * @param clazz         表类
     * @param pageNo        页码
     * @param pageSize      页数
     * @param selector      对象查询器
     * @return              分页信息,包括总页数,页码,页数和查询的记录
     * @throws ORMException 映射异常
     * @throws SQLException 数据库异常
     */
    public <T> PageResult<T> page(Class<T> clazz, int pageNo, int pageSize, Selector selector) throws ORMException, SQLException;
    

知启蒙数据库映射ZhiqimSQL示例

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ZHIQIM-SQL PUBLIC "-//ZHIQIM //DTD Zhiqim-Sql Configuration 1.5.0//EN" "http://zhiqim.org/xmldtds/zhiqim_sql_1_5_0.dtd">
<zhiqim-sql>
    <!-- 插入数据 -->
    <sql id="insert_user_info">
    <![CDATA[
        insert into USER_INFO (USER_ID, USER_NAME, USER_PASS, USER_EMAIL, USER_NICK, USER_AVATAR) 
            values (#USER_ID#, #USER_NAME#, #USER_PASS#, #USER_EMAIL#, #USER_NICK#, #USER_AVATAR#)
    ]]>
    </sql>
    
    <!-- 删除数据 -->
    <sql id="delete_user_info">
    <![CDATA[
        delete from USER_INFO where USER_ID=#USER_ID#
    ]]>
    </sql>
    
    <!-- 更新全部数据 -->
    <sql id="update_user_info">
    <![CDATA[
        update USER_INFO set USER_NAME=#USER_NAME#, USER_PASS=#USER_PASS#, USER_EMAIL=#USER_EMAIL#, USER_NICK=#USER_NICK#, USER_AVATAR=#USER_AVATAR# 
            where USER_ID=#USER_ID#
    ]]>
    </sql>
       
    <!-- 查询指定数据 -->
    <sql id="select_user_info">
    <![CDATA[
        select USER_NAME, USER_NICK from USER_INFO 
            where USER_NICK like '%#USER_NICK#%' and USER_EMAIL=#USER_EMAIL#
    ]]>
    </sql>
    
    <!-- 按月存储日志,查指定MONTH的日志列表 -->
    <sql id="query_user_log">
    <![CDATA[
        select * from USER_LOG_$MONTH$ where USER_ID=?
    ]]>
    </sql>
    
</zhiqim-sql>

知启蒙技术框架与交流


知启蒙技术框架架构图



QQ群:加入QQ交流群,请点击【458171582】

教程:欲知更多知启蒙数据库映射,【请戳这里】

木兰宽松许可证, 第2版 木兰宽松许可证, 第2版 2020年1月 http://license.coscl.org.cn/MulanPSL2 您对“软件”的复制、使用、修改及分发受木兰宽松许可证,第2版(“本许可证”)的如下条款的约束: 0. 定义 “软件”是指由“贡献”构成的许可在“本许可证”下的程序和相关文档的集合。 “贡献”是指由任一“贡献者”许可在“本许可证”下的受版权法保护的作品。 “贡献者”是指将受版权法保护的作品许可在“本许可证”下的自然人或“法人实体”。 “法人实体”是指提交贡献的机构及其“关联实体”。 “关联实体”是指,对“本许可证”下的行为方而言,控制、受控制或与其共同受控制的机构,此处的控制是指有受控方或共同受控方至少50%直接或间接的投票权、资金或其他有价证券。 1. 授予版权许可 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的版权许可,您可以复制、使用、修改、分发其“贡献”,不论修改与否。 2. 授予专利许可 每个“贡献者”根据“本许可证”授予您永久性的、全球性的、免费的、非独占的、不可撤销的(根据本条规定撤销除外)专利许可,供您制造、委托制造、使用、许诺销售、销售、进口其“贡献”或以其他方式转移其“贡献”。前述专利许可仅限于“贡献者”现在或将来拥有或控制的其“贡献”本身或其“贡献”与许可“贡献”时的“软件”结合而将必然会侵犯的专利权利要求,不包括对“贡献”的修改或包含“贡献”的其他结合。如果您或您的“关联实体”直接或间接地,就“软件”或其中的“贡献”对任何人发起专利侵权诉讼(包括反诉或交叉诉讼)或其他专利维权行动,指控其侵犯专利权,则“本许可证”授予您对“软件”的专利许可自您提起诉讼或发起维权行动之日终止。 3. 无商标许可 “本许可证”不提供对“贡献者”的商品名称、商标、服务标志或产品名称的商标许可,但您为满足第4条规定的声明义务而必须使用除外。 4. 分发限制 您可以在任何媒介中将“软件”以源程序形式或可执行形式重新分发,不论修改与否,但您必须向接收者提供“本许可证”的副本,并保留“软件”中的版权、商标、专利及免责声明。 5. 免责声明与责任限制 “软件”及其中的“贡献”在提供时不带任何明示或默示的担保。在任何情况下,“贡献者”或版权所有者不对任何人因使用“软件”或其中的“贡献”而引发的任何直接或间接损失承担责任,不论因何种原因导致或者基于何种法律理论,即使其曾被建议有此种损失的可能性。 6. 语言 “本许可证”以中英文双语表述,中英文版本具有同等法律效力。如果中英文版本存在任何冲突不一致,以中文版为准。 条款结束 如何将木兰宽松许可证,第2版,应用到您的软件 如果您希望将木兰宽松许可证,第2版,应用到您的新软件,为了方便接收者查阅,建议您完成如下三步: 1, 请您补充如下声明中的空白,包括软件名、软件的首次发表年份以及您作为版权人的名字; 2, 请您在软件包的一级目录下创建以“LICENSE”为名的文件,将整个许可证文本放入该文件中; 3, 请将如下声明文本放入每个源文件的头部注释中。 Copyright (c) [Year] [name of copyright holder] [Software Name] is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details. Mulan Permissive Software License,Version 2 Mulan Permissive Software License,Version 2 (Mulan PSL v2) January 2020 http://license.coscl.org.cn/MulanPSL2 Your reproduction, use, modification and distribution of the Software shall be subject to Mulan PSL v2 (this License) with the following terms and conditions: 0. Definition Software means the program and related documents which are licensed under this License and comprise all Contribution(s). Contribution means the copyrightable work licensed by a particular Contributor under this License. Contributor means the Individual or Legal Entity who licenses its copyrightable work under this License. Legal Entity means the entity making a Contribution and all its Affiliates. Affiliates means entities that control, are controlled by, or are under common control with the acting entity under this License, ‘control’ means direct or indirect ownership of at least fifty percent (50%) of the voting power, capital or other securities of controlled or commonly controlled entity. 1. Grant of Copyright License Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable copyright license to reproduce, use, modify, or distribute its Contribution, with modification or not. 2. Grant of Patent License Subject to the terms and conditions of this License, each Contributor hereby grants to you a perpetual, worldwide, royalty-free, non-exclusive, irrevocable (except for revocation under this Section) patent license to make, have made, use, offer for sale, sell, import or otherwise transfer its Contribution, where such patent license is only limited to the patent claims owned or controlled by such Contributor now or in future which will be necessarily infringed by its Contribution alone, or by combination of the Contribution with the Software to which the Contribution was contributed. The patent license shall not apply to any modification of the Contribution, and any other combination which includes the Contribution. If you or your Affiliates directly or indirectly institute patent litigation (including a cross claim or counterclaim in a litigation) or other patent enforcement activities against any individual or entity by alleging that the Software or any Contribution in it infringes patents, then any patent license granted to you under this License for the Software shall terminate as of the date such litigation or activity is filed or taken. 3. No Trademark License No trademark license is granted to use the trade names, trademarks, service marks, or product names of Contributor, except as required to fulfill notice requirements in Section 4. 4. Distribution Restriction You may distribute the Software in any medium with or without modification, whether in source or executable forms, provided that you provide recipients with a copy of this License and retain copyright, patent, trademark and disclaimer statements in the Software. 5. Disclaimer of Warranty and Limitation of Liability THE SOFTWARE AND CONTRIBUTION IN IT ARE PROVIDED WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED. IN NO EVENT SHALL ANY CONTRIBUTOR OR COPYRIGHT HOLDER BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE SOFTWARE OR THE CONTRIBUTION IN IT, NO MATTER HOW IT’S CAUSED OR BASED ON WHICH LEGAL THEORY, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 6. Language THIS LICENSE IS WRITTEN IN BOTH CHINESE AND ENGLISH, AND THE CHINESE VERSION AND ENGLISH VERSION SHALL HAVE THE SAME LEGAL EFFECT. IN THE CASE OF DIVERGENCE BETWEEN THE CHINESE AND ENGLISH VERSIONS, THE CHINESE VERSION SHALL PREVAIL. END OF THE TERMS AND CONDITIONS How to Apply the Mulan Permissive Software License,Version 2 (Mulan PSL v2) to Your Software To apply the Mulan PSL v2 to your work, for easy identification by recipients, you are suggested to complete following three steps: i Fill in the blanks in following statement, including insert your software name, the year of the first publication of your software, and your name identified as the copyright owner; ii Create a file named “LICENSE” which contains the whole context of this License in the first directory of your software package; iii Attach the statement to the appropriate annotated syntax at the beginning of each source file. Copyright (c) [Year] [name of copyright holder] [Software Name] is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. See the Mulan PSL v2 for more details.

简介

Zhiqim ORM即知启蒙数据库映射,既有比MyBatis更简单的动态SQL,又有比Hibernate更彻底的对象关系映射。更是100%全程NoSQL的数据库映射框架,支持6种数据库和9种数据库类型无缝切换。 展开 收起
Java
MulanPSL-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/zhiqim/zhiqim_orm.git
git@gitee.com:zhiqim/zhiqim_orm.git
zhiqim
zhiqim_orm
zhiqim_orm
master

搜索帮助