int 类型的自增长ID生成类,支持多线程。
来源:互联网 发布:js windows调用firefox 编辑:程序博客网 时间:2024/05/22 05:20
/* * @(#)IdGenerator.java Project:androidkit * Date:2013-5-2 * * Copyright (c) 2013 CFuture09, Institute of Software, * Guangdong Ocean University, Zhanjiang, GuangDong, China. * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package com.lurencun.cfuture09.androidkit.utils.lang;/** * @author Geek_Soledad (66704238@51uc.com) */public interface IdGenerator<T> { /** * 生成下一个id并返回。 * * @return 返回新的id. */ public T next();}
/** * int 类型的自增长ID生成类,支持多线程。 * * @Author Geek_Soledad (66704238@51uc.com) */public class IncreaseIntId implements IdGenerator<Integer> { private AtomicInteger id; public IncreaseIntId() { id = new AtomicInteger(); } public IncreaseIntId(int initialId) { id = new AtomicInteger(initialId); } @Override public Integer next() { return id.incrementAndGet(); }}
0 0
- int 类型的自增长ID生成类,支持多线程。
- long 类型的自增长ID生成类,支持多线程。
- Mycat批量插入与ID自增长结合的支持
- 自增类型ID支持
- 产生自增长ID的存储过程
- MyBatis获取Id自增长的值
- SQLITE3 清除自增长ID的办法
- 自增长的ID重新排列
- MySQL重置自增长的id
- MongoDB自增长ID的实现
- mybatis-generator 自增长ID 的获取
- Oracle ID自增长的设置
- phpmyadmin的id字段自增长设置
- 查看MySQL的自增长ID
- 解决Hibernate生成的表的代理主键(id)不是自增长
- Oracle ID自增长
- oracle ID自增长
- oracle id 自增长
- 得到当前日期是星期几
- ASP.NET 5简介
- ser2net安装使用说明
- Mongod 芒果数据库初学.
- Ldom can't boot from vdisk ( Can't open disk label package )
- int 类型的自增长ID生成类,支持多线程。
- MySQL- SHOW TABLE STATUS命令
- Eclipse上配置MonkeyRunner(Windows)
- 解读ASP.NET 5 & MVC6系列(2):初识项目
- session 注册简单验证码的实现
- ibatis resultMap使用的问题
- iOS 获取Wi-Fi的SSID
- 算法:两种对拼音进行智能切分的方法
- cxf发布webservice