zoukankan      html  css  js  c++  java
  • 注解收集

     java原生

    Java自带

    @SuppressWarnings("ALL")

    方法,类

    吃掉警告

    @Override,

    方法

    重写

    @Deprecated

    方法

    不建议使用

    spring

    @Service  @Component  @Repository

    类,注册在spring container

    @Autried @qualifier

    member variable

    代表依赖注入

    @config

    class,代变配置文件

    @bean

    method,代变注册一个bean

    @Transactional

    事务控制

    @Nullable

    method,parameter not null,return parameter may be null

    SpringBoot

    @springbootApplication

    class,启动

    @GetMapping/ @PostMapping

     = @RequestMapping(method = RequestMethod.GET/Post)

    springmvc

    @controller

    类,接受请求,也是注册在spring容器

    @RequestMapping("/cat") / (value = "/cat")

    类,方法,写映射路径,加方法method = RequestMethod.POST

    @RequestBody

    parameter, json 转 entity

    @ResponseBody

    方法,类,entity 转 json

    @RestController

    在类上 responseBody + controller

    json

    jsr验证

    Lombok

    val:放在local variable

     NonNull: parameter, member variable

     cleanup:resource variable自动close

     getter/ setter : member variable

    tostring:class

    AllArgsConstructor/ NoArgsConstructor/ RequiredArgsConstructor: 后面那个 只有final 或者 nonNull的field才能用

    data:@ToString, @EqualsAndHashCode, @Getter/setter(非final)@RequiredArgsConstructor

    build: 构造器模式,不搞static

    synchronized: static class lock, object lock, custom lock是不同的

     getter(lazy=true)懒加载

     log和sfl4j : 两种流派的日志

    JPA

     embeddable: 两个类嵌入到一个表

    oneToMany:会创建新表(mappered=“value”)整合在一个表

    manyToOne: 

    manyToMany

  • 相关阅读:
    C++指针
    Linux Ubuntu常用终端命令
    java-JDBC-Oracle数据库连接
    HDU 1890 区间反转
    Hdu-3487 Splay树,删除,添加,Lazy延迟标记操作
    UVa 10088
    UVa10025-The ? 1 ? 2 ? ... ? n = k problem
    UVa10023手动开大数平方算法
    UVa 10007
    点的双联通+二分图的判定(poj2942)
  • 原文地址:https://www.cnblogs.com/vhyc/p/12171853.html
Copyright © 2011-2022 走看看