JDBC Extension

ModelMapper JDBC Extension

License

License

Categories

Categories

ModelMapper General Purpose Libraries Bean Mapping
GroupId

GroupId

com.v1ok
ArtifactId

ArtifactId

modelmapper-jdbc
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

JDBC Extension
ModelMapper JDBC Extension
Source Code Management

Source Code Management

https://github.com/liubinduo/uuid

Download modelmapper-jdbc

How to add to project

<!-- https://jarcasting.com/artifacts/com.v1ok/modelmapper-jdbc/ -->
<dependency>
    <groupId>com.v1ok</groupId>
    <artifactId>modelmapper-jdbc</artifactId>
    <version>0.1.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.v1ok/modelmapper-jdbc/
implementation 'com.v1ok:modelmapper-jdbc:0.1.0'
// https://jarcasting.com/artifacts/com.v1ok/modelmapper-jdbc/
implementation ("com.v1ok:modelmapper-jdbc:0.1.0")
'com.v1ok:modelmapper-jdbc:jar:0.1.0'
<dependency org="com.v1ok" name="modelmapper-jdbc" rev="0.1.0">
  <artifact name="modelmapper-jdbc" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.v1ok', module='modelmapper-jdbc', version='0.1.0')
)
libraryDependencies += "com.v1ok" % "modelmapper-jdbc" % "0.1.0"
[com.v1ok/modelmapper-jdbc "0.1.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.modelmapper : modelmapper jar 2.3.2
org.projectlombok : lombok Optional jar 1.18.6
org.slf4j : slf4j-api jar 1.7.25

Project Modules

There are no modules declared in this project.

uuid

这是一个生成UUID的工具,实现了两种标准的UUID。 uuid and snowflake

jar用法

IDGenerate idg = IDGenerateBuilder.builder(GenerateType.SNOWFLAKE)
                                  .setWorkerId(workerId)
                                  .setDataCenterId(dataCenterId)
                                  .setEpoch(epoch)
                                  .setBase(base)
                                  .build();

String id = idg.nextIdToString()  or long id = idg.nextIdtoLong();

Spring Boot 用法

在 pom.xml 引用

<dependency>
   <groupId>com.v1ok</groupId>
   <artifactId>uuid</artifactId>
   <version>${version}</version>
</dependency>

在application.properties文件中加入配置 uuid.type=snowflake 或者 uuid.type=uuid

@RestController
public class Demo {

  @Autowired
  IDGenerate generate;

  @GetMapping
  public Object test(){
    try {
      return generate.nextIdToLong();
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
    return null;
  }
}

Config

uuid.type                   // UUID类型   取值范围:snowflake, uuid
uuid.snowflake.workerId     //机器ID       取值范围:(0~31)
uuid.snowflake.dataCenterId //数据中心ID   取值范围:(0~31)
uuid.snowflake.epoch        //纪元时间戳 
uuid.snowflake.base         //toString 时的进制数,取值范围:2~36

Versions

Version
0.1.0