springboot uses the PropertyResource annotation to read the properties of the specified configuration file (podcast code)

Chapter one: SpringBoot/Spring uses @ Value for attribute binding (podcast code for wisdom spreading)   The ConfigurationProperties annotation will read the properties from the global configuration file by default. When there are many properties, the main configuration file(application.yml, application.properties) will be bloated, so it is ne ...

Posted by Nimbuz on Mon, 06 Apr 2020 19:01:17 +0200

Phoenix + HBase, let you operate HBase like MySQL

Operation of Phoenix associated HBase (three cases) Situation 1: Hbase already has existing tables. You can create corresponding views in Phoenix. Views can only be queried, not added, deleted or modified Table has been created and data exists in hbase, table name: phoenix Create the corresponding view in phoenix create view "phoenix"( pk ...

Posted by estero2002 on Wed, 01 Apr 2020 21:47:10 +0200

spring cycle dependency problem

1. The cause of circular dependency - injected through the constructor Let's define two interdependent bean s (injected through the constructor): @Component public class CircularDependencyA { private CircularDependencyB circB; @Autowired public CircularDependencyA(CircularDependencyB circ ...

Posted by headbangerbuggy on Wed, 11 Mar 2020 10:49:06 +0100

Spring AOP 2. X implementation of pre, post, surround and exception notification based on namespace configuration

SpringAop 2.x Introduction: The principle of namespace based configuration is to use post processor, which is simpler. Characteristic: Simplified configuration, There is no need to implement any interface when writing non intrusive notifications. Use the AspectJ expression to define the tangent point. B ...

Posted by snidog on Fri, 21 Feb 2020 07:17:00 +0100

XML based declarative transaction control configuration steps in Spring

1. Import Maven coordinates <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>5.0.2.RELEASE</version> </dependency> <de ...

Posted by fiorelina21 on Thu, 20 Feb 2020 07:36:28 +0100

Getting started with FreeMarker

1. What is FreeMarker FreeMarker is a template engine: a template based, used to generate output text (any text from HTML format is used to automatically generate the source Code). It is a development package or class library for Java programmers. FreeMarker's design is actually used to generate HTML ...

Posted by b-real on Thu, 13 Feb 2020 07:42:30 +0100

2. Spring integrates Spring data jpa complex query

Article directory Environment creation and simple query, see the previous article 1Specifications dynamic query 1.1 query single object according to conditions 1.2 multi criteria query 1.3 fuzzy matching, sorting 1.4 paging query 2. Relationship between multiple tables and operation steps of multip ...

Posted by SpaceLincoln on Fri, 07 Feb 2020 13:21:16 +0100

Learning code: DI dependency injection of hand written Spring

I wrote the IOC implementation of spring before, but now I write the implementation of DI dependency injection Paste class diagram Because junit package will be used when DI is implemented for testing, import dependency in pom.xml <!--SpringDI--> <dependency> &lt ...

Posted by Kingskin on Sat, 11 Jan 2020 18:06:09 +0100

[Spring Boot Unit Test] 1. Write unit tests

Writing unit tests can help developers write high-quality code, improve code quality, reduce bugs, and facilitate refactoring.Spring Boot provides utilities and annotations to help us test applications. Opening unit tests in Spring Boot requires only the introduction of spring-boot-starter-test, which includes some of the mainstream test librar ...

Posted by suzuki on Sat, 04 Jan 2020 18:59:07 +0100

In the message sent by rabbitmq template, the Date type field is 8 hours later than the current time

Preface The problem encountered in the previous development process is that the time in the message body is 8 hours less than the current time when the rabbitmq template is used to send messages. This is the time zone problem. Let's talk about why it appears. The previous configuration is as follows: @Bean public RabbitTemplate rabbitTempl ...

Posted by lanjoky on Fri, 27 Dec 2019 12:43:39 +0100