在实体类中添加@TableId注解: @Data public class DxApplication { @TableId(type = IdType.AUTO) private Long id; private String name; private Integer sort; } 在navi ...
                            
                            
                                分类:
其他好文   时间:
2021-06-11 18:35:34   
                                阅读次数:
0
                             
                    
                        
                            
                            
                                
                    问题:两个module,A module引用了B module的一个类,A module添加了 B module的依赖,且这个类也通过注解注册到了bean工厂,但是A module 使用@Autowire 自动装配bean时报错, 以为可能是伪报错,运行也报错了 解决方法: 在启动类的SpringB ...
                            
                            
                                分类:
编程语言   时间:
2021-06-10 18:53:06   
                                阅读次数:
0
                             
                    
                        
                            
                            
                                web.xml的配置 <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-inst ...
                            
                            
                                分类:
编程语言   时间:
2021-06-10 18:32:56   
                                阅读次数:
0
                             
                    
                        
                            
                            
                                
                    @PostConstruct基本:@PostConstruct注解不是Spring提供的;是Java自己提供的注解。 Java中该注解的说明:1.@PostConstruct该注解被用来修饰一个非静态的void()方法。2.被@PostConstruct修饰的方法会在服务器加载Servlet的时候运 ...
                            
                            
                                分类:
其他好文   时间:
2021-06-08 23:18:06   
                                阅读次数:
0
                             
                    
                        
                            
                            
                                
                    一、性能优化 1、属性properties 2、类型别名typeAliases 2.1、给每一个实体类取别名 2.2、扫描一个包 注意:2.1可以自己取别名;2.2默认会使用 Bean 的首字母小写的非限定类名来作为它的别名,如果要想自己起别名,需要在实体类上面添加注解 3、设置settings 看 ...
                            
                            
                                分类:
其他好文   时间:
2021-06-07 20:53:24   
                                阅读次数:
0
                             
                    
                        
                            
                            
                                
                    一、 消息队列概述 消息队列是指利用高效可靠的消息传递机制进行与平台无关的数据交流,并基于数据通信来进行分布式系统的集成。 通过提供消息传递和消息排队模型,它可以在分布式环境下提供应用解耦、弹性伸缩、冗余存储、流量削峰、异步通信、数据同步 等等功能,其作为 分布式系统架构 中的一个重要组件,有着举足 ...
                            
                            
                                分类:
其他好文   时间:
2021-06-06 18:50:48   
                                阅读次数:
0
                             
                    
                        
                            
                            
                                
                    EnableAutoConfiguration This class-level annotation tells Spring Boot to “guess” how you want to configure Spring, based on the jar dependencies that  ...
                            
                            
                                分类:
其他好文   时间:
2021-06-04 19:47:18   
                                阅读次数:
0
                             
                    
                        
                            
                            
                                从3.1开始,Spring引入了对Cache的支持。其使用方法和原理都类似于Spring对事务管理的支持。Spring Cache是作用在方法上的,其核心思想是这样的:当我们在调用一个缓存方法时会把该方法参数和返回结果作为一个键值对存放在缓存中,等到下次利用同样的参数来调用该方法时将不再执行该方法, ...
                            
                            
                                分类:
编程语言   时间:
2021-06-04 19:34:35   
                                阅读次数:
0
                             
                    
                        
                            
                            
                                
                    @NotEmpty 用在集合类上面加了@NotEmpty的String类、Collection、Map、数组,是不能为null或者长度为0的(String Collection Map的isEmpty()方法)@NotBlank只用于String,不能为null且trim()之后size>0@Not ...
                            
                            
                                分类:
其他好文   时间:
2021-06-04 19:22:27   
                                阅读次数:
0
                             
                    
                        
                            
                            
                                
                    @Transactional 是声明式事务管理 编程中使用的注解 一、添加位置 1、接口实现类或接口实现方法上,而不是接口类中。 2、访问权限:public 的方法才起作用。 @Transactional 注解应该只被应用到 public 方法上,这是由 Spring AOP 的本质决定的。 3、系 ...
                            
                            
                                分类:
其他好文   时间:
2021-06-04 19:03:04   
                                阅读次数:
0