• How Java annotations implement distributed locks based on redission


    This article mainly introduces how to realize the distributed lock based on Redission with Java annotation. The sample code in this article is very detailed, which has a certain reference value for everyone to learn or work 1. Define annotation class @Target({ ElementType.METHOD }) @Retention(RetentionPolicy.RUNTIME) @Documented public @interface DistributedLock { //Lock name String lockName() default […]

  • How to add annotation to spring @ async method to realize asynchronous call


    This article mainly introduces how to add annotation to spring @ async method to realize asynchronous call. The example code is introduced in detail in this article, which has certain reference value for your study or work. You can refer to In the process of using spring framework, we will use @ async annotation to […]

  • Example of implementing declarative transaction operation with annotation in spring practice


    The example of this article describes the implementation of declarative transaction operations with annotations in spring practice. To share with you for your reference, as follows: One configuration file <?xml version=”1.0″ encoding=”GBK”?> <beans xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns=”http://www.springframework.org/schema/beans” xmlns:p=”http://www.springframework.org/schema/p” xmlns:aop=”http://www.springframework.org/schema/aop” xmlns:tx=”http://www.springframework.org/schema/tx” xsi:schemaLocation=”http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd”> <! — define data source bean, use c3p0 data source to […]

  • Hibernate validator usage and custom validator annotation


    Jsr-303 is a sub specification in Java EE 6, called bean validation, which is used to validate the values of fields in java bean. Hibernate validator is an implementation of this specification provided by hibernate. ——Hibernate validator is used for parameter verification. Use the annotation provided by hibernate validator for parameter verification annotation interpretation @Null […]

  • Spring boot HTTP request annotation @ restcontroller principle analysis


    This article mainly introduces the principle analysis of spring boot HTTP request annotation @ restcontroller, which is introduced in detail through the example code. It has certain reference learning value for your study or work. You can refer to the following for your friends @RestController @Restcontroller = @ controller + @ ResponseBody. Two comrades on […]

  • Help in-depth learning! Alibaba open source pluggable GPU sharing scheduling tool


    According to Gartner’s survey of global CIOs, AI will become a disruptive force in the organizational revolution in 2019. For AI, computing power is justice, and cost is ability. Using docker and kubernetes on behalf of cloud native technology provides a new working mode for AI. GPU machines are put into a unified resource pool […]

  • The best practice of mybatis plus annotation to realize multi table associated query


    In the previous article, we mentioned the practical scheme of annotation binding Association query in mybatis multi table Association non SQL general scheme. Here we will summarize and sort out the common development scenarios that need to involveRelationThe scenario of and how it is bound to be supported. 1. Annotation automatically binds the display value […]

  • Differences between @ Autowired and @ resource annotations in spring framework


    Differences between @ Autowired and @ resource annotations in spring framework In the spring framework, in addition to its unique annotations, JSR-250-based annotations are used, which include @PostConstruct, @PreDestroy and @Resource annotations. First, let’s briefly understand the @ postconstruct and @ predestroy annotations: To define the installation and uninstallation of a bean, we can use […]

  • Differences between @Service and @Resource annotations in Spring


    Differences between @Service and @Resource annotations in Spring 1 Preface When we use spring framework, annotations are an “indispensable” part. She helps us get rid of the tedious task of configuring XML files, but one thing we need to grasp is “3He”, that is, “When, Where and Where to Annotate?” In this blog post, the […]

  • Spring AOP Based on Annotation Explanation and Example Code


    Spring AOP Annotation-based Explanation and Example Code 1. Enable spring support for @AspectJ annotations: <beans xmlns:aop=”http://www.springframework.org/schema/aop”…> <! – Start up support – >. <aop:aspectj-autoproxy /> </beans> Annotation Aware AspectJAuto ProxyCreator Bean can also be configured to start Spring’s support for @AspectJ annotations <beans…> <bean /> </beans> 2. In order to start the support of @AspectJ […]

  • Flutter Series: 4. Annotation-based Code Generation Applications


    Preface Serialization of API data into model instances is a very common and basic technology point in mobile development. Thanks to dynamic technology such as runtime, we can easily achieve serialization in IOS development with the help of JSONModel or Swifty JSON. The serialization experience is undoubtedly very bad for developers who have just come […]

  • API Hiding and Grouping Details when Using Swagger in Asp.Net Core Web API


    1. Preface Why do we hide some interfaces? Because when we use swagger instead of interface, some interfaces will inevitably be exposed intuitively. For example, when we use it together with Consul, we will expose the health check interface and alarm notification interface. Sometimes these interfaces will be for convenience, without encryption. At this time, […]