参照官方文档,有详细说明和使用实例 Maven plugins
背景 使用AutoConfigure*或者SpringBootTest进行测试的时候,如果不手动设置@AutoConfigureTestDat
问题背景 DROP VIEW temp_view; 报错信息: Can't drop temp_view,because *** depend on it 解决方案 DROP VIEW temp_view CASCADE ; 该sql会删除所有依赖的视图
问题背景 错误日志: org.apache.thrift.TApplicationException: [?] : out of sequence response 问题原因 hive连接在连接池中,同时两个线程去获取并执行,两个都有close操作。 参考hive jira
ufw指令是ubuntu/debian体系的防火墙指令,它对原本的iptables指令进行了封装,对比iptables指令,ufw更加简洁有
XmlMapper 依赖 <dependency> <groupId>com.fasterxml.jackson.dataformat</groupId> <artifactId>jackson-dataformat-xml</artifactId> </dependency> 基础类 @Data class SimpleBean { private int x = 1; private int y = 2; } 序列化到xml String @Test public void whenJavaSerializedToXmlStr_thenCorrect() throws JsonProcessingException { XmlMapper xmlMapper = new XmlMapper(); String xml = xmlMapper.writeValueAsString(new SimpleBean()); assertNotNull(xml); } 得到的结果: <SimpleBean> <x>1</x> <y>2</y> </SimpleBean> 序列化到xml File
@Configuration @MapperScan(basePackages = MysqlDatasourceConfig.PACKAGE, sqlSessionFactoryRef = "mysqlSessionFactory") public class MysqlDatasourceConfig { public static final String PACKAGE = "com.ming.mapper.mysql1"; public static final String MAPPER_LOCATION = "classpath:mapper/mysql1/*.xml"; @Primary @Bean(name = "mysqlDatasource") @ConfigurationProperties("spring.datasource.druid.mysql1") public DataSource mysqlDataSource(){ return DruidDataSourceBuilder.create().build(); } @Bean(name = "mysqlTransactionManager") @Primary public DataSourceTransactionManager mysqlTransactionManager() { return new DataSourceTransactionManager(mysqlDataSource()); } @Bean(name = "mysqlSessionFactory") @Primary public SqlSessionFactory mysqlSessionFactory(@Qualifier("mysqlDatasource") DataSource dataSource) throws Exception { final SqlSessionFactoryBean sessionFactory = new SqlSessionFactoryBean(); sessionFactory.setDataSource(dataSource); sessionFactory.setMapperLocations(new PathMatchingResourcePatternResolver().getResources(MysqlDatasourceConfig.MAPPER_LOCATION)); return