cc.eamon.open:mapping

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

License

License

GroupId

GroupId

cc.eamon.open
ArtifactId

ArtifactId

mapping
Last Version

Last Version

1.0.5-ALPHA
Release Date

Release Date

Type

Type

jar
Description

Description

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/
Source Code Management

Source Code Management

https://github.com/ymxiong/mapping

Download mapping

How to add to project

<!-- https://jarcasting.com/artifacts/cc.eamon.open/mapping/ -->
<dependency>
    <groupId>cc.eamon.open</groupId>
    <artifactId>mapping</artifactId>
    <version>1.0.5-ALPHA</version>
</dependency>
// https://jarcasting.com/artifacts/cc.eamon.open/mapping/
implementation 'cc.eamon.open:mapping:1.0.5-ALPHA'
// https://jarcasting.com/artifacts/cc.eamon.open/mapping/
implementation ("cc.eamon.open:mapping:1.0.5-ALPHA")
'cc.eamon.open:mapping:jar:1.0.5-ALPHA'
<dependency org="cc.eamon.open" name="mapping" rev="1.0.5-ALPHA">
  <artifact name="mapping" type="jar" />
</dependency>
@Grapes(
@Grab(group='cc.eamon.open', module='mapping', version='1.0.5-ALPHA')
)
libraryDependencies += "cc.eamon.open" % "mapping" % "1.0.5-ALPHA"
[cc.eamon.open/mapping "1.0.5-ALPHA"]

Dependencies

compile (4)

Group / Artifact Type Version
com.squareup : javapoet jar 1.8.0
com.google.guava : guava jar 27.0.1-jre
com.alibaba : fastjson jar 1.2.60
org.slf4j : slf4j-api jar 1.7.26

system (1)

Group / Artifact Type Version
com.sun » tools jar 1.8

Project Modules

There are no modules declared in this project.

Mapping

中文地址移步:

https://github.com/ymxiong/Mapping/blob/master/README_zh.md

Target

Using @Mapper @MapperIgnore @MapperRename @MapperModify and @MapperExtra annotations to simplify your entity system. Those annotations can work in with each other, using to modify, transform, and bundle entity attribute information, which is easy to provide to front-end developer for revealing, and also facilitates background developer's management.

Installation

Add the dependency to your pom.xml

<dependency>
    <groupId>cc.eamon.open</groupId>
    <artifactId>mapping</artifactId>
    <version>${mapping-version}</version>
</dependency>

Usage

Start Up

  1. Add @Mapper annotation to your entity,and create get&set methods of your properties(You can work in with lombok)

    @Mapper
    public class User {
        private int id;
    	...
    }
  2. Complie your project, the UserDefaultMapper will be automatically generated, which includeMap<> getMap(User obj) andUser getEntity() two main method.

    public class UserDefaultMapper {
        public int id;
        /**
        * Static Method, Invoke Directly
        */
        public static Map<String, Object> getMap(User obj) {
            Map<String, Object> resultMap = new LinkedHashMap<>();
            if (obj == null) return resultMap;
            resultMap.put("id", obj.getId());
            return resultMap;
        }
        /**
        * Using After Instantiate Mapper
        */
        public User getEntity() {
            User entity = new User();
            entity.setId(this.id);
            return entity;
        }
    }

Versions

Version
1.0.5-ALPHA
1.0.3-ALPHA
1.0.2-ALPHA
1.0.1-ALPHA
1.0.0
1.0.0-ALPHA
0.1.3