初始化第一版influxORM
This commit is contained in:
27
src/main/java/com/njcn/influx/ano/Delete.java
Normal file
27
src/main/java/com/njcn/influx/ano/Delete.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package com.njcn.influx.ano;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 删除记录注解
|
||||
* @author hongawen
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Delete {
|
||||
|
||||
/**
|
||||
* 用于传参
|
||||
* @return String 参数内容
|
||||
*/
|
||||
String value();
|
||||
|
||||
/***
|
||||
* 数据库名
|
||||
* todo... 处理成获取配置文件内的,减少开发人员编码输出
|
||||
*/
|
||||
String database();
|
||||
}
|
||||
15
src/main/java/com/njcn/influx/ano/Insert.java
Normal file
15
src/main/java/com/njcn/influx/ano/Insert.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.njcn.influx.ano;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 插入注解
|
||||
* @author hongawen
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Insert {
|
||||
}
|
||||
14
src/main/java/com/njcn/influx/ano/Param.java
Normal file
14
src/main/java/com/njcn/influx/ano/Param.java
Normal file
@@ -0,0 +1,14 @@
|
||||
package com.njcn.influx.ano;
|
||||
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* 便于将方法中的参数赋值进注解内容中,通过#{paramName}
|
||||
* @author hongawen
|
||||
*/
|
||||
@Documented
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.PARAMETER})
|
||||
public @interface Param {
|
||||
String value();
|
||||
}
|
||||
25
src/main/java/com/njcn/influx/ano/Select.java
Normal file
25
src/main/java/com/njcn/influx/ano/Select.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.njcn.influx.ano;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 查询记录
|
||||
* @author hongawen
|
||||
*/
|
||||
@Target(ElementType.METHOD)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Select {
|
||||
|
||||
/***
|
||||
* 查询sql
|
||||
*/
|
||||
String value();
|
||||
|
||||
/***
|
||||
* 返回映射的实体对象
|
||||
*/
|
||||
Class resultType();
|
||||
}
|
||||
Reference in New Issue
Block a user