中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

網(wǎng)盤做網(wǎng)站服務器網(wǎng)絡推廣營銷方案100例

網(wǎng)盤做網(wǎng)站服務器,網(wǎng)絡推廣營銷方案100例,直銷公司排名,網(wǎng)站建設南京公司網(wǎng)站建設SpringBoot之自定義Jackson反序列化日期類型轉換配置類 文章目錄 SpringBoot之自定義Jackson反序列化日期類型轉換配置類1. SpringBoot版本2. 統(tǒng)一事務管理配置類3. 主啟動類加入開啟事務的注解 統(tǒng)一事務管理配置 1. SpringBoot版本 <parent><groupId>org.springfr…

SpringBoot之自定義Jackson反序列化日期類型轉換配置類

文章目錄

  • SpringBoot之自定義Jackson反序列化日期類型轉換配置類
  • 1. SpringBoot版本
  • 2. 統(tǒng)一事務管理配置類
  • 3. 主啟動類加入開啟事務的注解

統(tǒng)一事務管理配置

1. SpringBoot版本

 <parent><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>2.3.5.RELEASE</version></parent>
<dependencies><dependency><groupId>org.aspectj</groupId><artifactId>aspectjweaver</artifactId><version>1.9.7</version></dependency></dependencies>

2. 統(tǒng)一事務管理配置類

package com.yuan.webframework.config;import org.aspectj.lang.annotation.Aspect;
import org.springframework.aop.Advisor;
import org.springframework.aop.aspectj.AspectJExpressionPointcut;
import org.springframework.aop.support.DefaultPointcutAdvisor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.interceptor.DefaultTransactionAttribute;
import org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource;
import org.springframework.transaction.interceptor.TransactionInterceptor;/*** <p>* Description: 統(tǒng)一事務管理配置* </p>** @author jinshengyuan* @since 2022/8/5 16:35*/
@Aspect
@Configuration
public class TransactionManagerConfig {//切點表達式private static final String AOP_POINT_EXPRESSION = "execution(* com.zx.*.**.service.impl.*.*(..))  or execution(* org.snaker.engine..*.*(..))";@AutowiredPlatformTransactionManager transactionManager;//注入平臺(Mybatis)事務管理器@Beanpublic TransactionInterceptor txAdvice(){//增刪改DefaultTransactionAttribute txRequired = new DefaultTransactionAttribute();txRequired.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);txRequired.rollbackOn(new Throwable());txRequired.setIsolationLevel(TransactionDefinition.ISOLATION_READ_COMMITTED);//除了指定前綴開頭的以外,其他方法也支持事務DefaultTransactionAttribute txRequiredAll = new DefaultTransactionAttribute();txRequiredAll.setPropagationBehavior(TransactionDefinition.PROPAGATION_SUPPORTS);txRequiredAll.rollbackOn(new Throwable());txRequiredAll.setIsolationLevel(TransactionDefinition.ISOLATION_READ_COMMITTED);//查DefaultTransactionAttribute txRequiredReadOnly = new DefaultTransactionAttribute();txRequiredReadOnly.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);txRequiredReadOnly.setReadOnly(true);NameMatchTransactionAttributeSource source = new NameMatchTransactionAttributeSource();//切入點切入以下的方法為事務方法source.addTransactionalMethod("add*",txRequired);source.addTransactionalMethod("save*",txRequired);source.addTransactionalMethod("insert*",txRequired);source.addTransactionalMethod("update*",txRequired);source.addTransactionalMethod("modify*",txRequired);source.addTransactionalMethod("delete*",txRequired);source.addTransactionalMethod("change*",txRequired);source.addTransactionalMethod("move*",txRequired);source.addTransactionalMethod("remove*",txRequired);source.addTransactionalMethod("submit*",txRequired);source.addTransactionalMethod("distribute*",txRequired);source.addTransactionalMethod("cancel*",txRequired);source.addTransactionalMethod("batch*",txRequired);source.addTransactionalMethod("sync*",txRequired);source.addTransactionalMethod("set*",txRequired);source.addTransactionalMethod("*",txRequiredAll);//切入點切入的以下的方法為只讀事務方法source.addTransactionalMethod("get*",txRequiredReadOnly);source.addTransactionalMethod("query*",txRequiredReadOnly);source.addTransactionalMethod("select*",txRequiredReadOnly);source.addTransactionalMethod("count*",txRequiredReadOnly);source.addTransactionalMethod("find*",txRequiredReadOnly);source.addTransactionalMethod("search*",txRequiredReadOnly);source.addTransactionalMethod("is*",txRequiredReadOnly);return  new TransactionInterceptor(transactionManager,source);}//事務切入點@Beanpublic Advisor txAdviceAdvisor(){AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut();pointcut.setExpression(AOP_POINT_EXPRESSION);return new DefaultPointcutAdvisor(pointcut,txAdvice());}}

3. 主啟動類加入開啟事務的注解

如主啟動類中加入@EnableTransactionManagement注解,如下

package com.yuan;import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.transaction.annotation.EnableTransactionManagement;@Slf4j
@EnableTransactionManagement
@SpringBootApplication
public class MyApplication {public static void main(String[] args) throws UnknownHostException {SpringApplication.run(MyApplication.class, args);}
}
http://www.risenshineclean.com/news/3962.html

相關文章:

  • 在線做視頻網(wǎng)站如何建立自己的網(wǎng)站
  • 網(wǎng)站做編輯賺錢seo系統(tǒng)是什么
  • 做優(yōu)秀網(wǎng)站seo待遇
  • 網(wǎng)站 框架圖希愛力副作用太強了
  • 網(wǎng)站在線制作生成個人網(wǎng)站推廣
  • 做網(wǎng)站真實收益騰訊云域名購買
  • 刷網(wǎng)站關做個網(wǎng)站需要多少錢
  • 貴陽網(wǎng)站建設q.479185700棒谷歌瀏覽器在線入口
  • 網(wǎng)站關鍵詞排名優(yōu)化應該怎么做培訓心得總結怎么寫
  • 黑龍江住房和城鄉(xiāng)建設廳網(wǎng)站seo網(wǎng)站排名優(yōu)化公司
  • 免費的站外推廣網(wǎng)絡營銷專業(yè)是學什么的
  • 網(wǎng)站開發(fā)搜索功能怎么實現(xiàn)泰安做百度推廣的公司
  • 株洲網(wǎng)站設計外包運營百度廣告電話號碼是多少
  • wordpress 付費下資源 插件武漢網(wǎng)站營銷seo方案
  • 主題資源網(wǎng)站制作平臺騰訊會議多少錢一個月
  • 做相框的網(wǎng)站富陽網(wǎng)站seo價格
  • 建一個公司網(wǎng)站網(wǎng)站營銷策劃
  • 分析一個網(wǎng)站湖南網(wǎng)絡推廣機構
  • 公司做網(wǎng)站的費用記到哪個科目推廣引流網(wǎng)站
  • 深圳做公司網(wǎng)站他達拉非片
  • ninety wordpress插件湖南網(wǎng)站seo地址
  • 幫一個企業(yè)做網(wǎng)站流程網(wǎng)絡整合營銷是什么意思
  • 電影網(wǎng)站域名seo營銷推廣
  • 沒有網(wǎng)站可以做seo排名嗎個人對網(wǎng)絡營銷的看法
  • 安徽做網(wǎng)站的公司專門做推廣的公司
  • 創(chuàng)業(yè)網(wǎng)站怎么做如何推廣自己的微信公眾號
  • 山西網(wǎng)站建設設計百度seo
  • 做調查問卷用的網(wǎng)站或軟件今日百度搜索風云榜
  • 用php做網(wǎng)站難嗎南昌seo全網(wǎng)營銷
  • 重慶市工程建設信息網(wǎng)新網(wǎng)站網(wǎng)頁設計圖