Here are the examples of the java api @org.springframework.transaction.annotation.EnableTransactionManagement taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
691 Examples
18
View Source File : RocketMqTxApplication.java
License : Apache License 2.0
Project Creator : zlt2000
License : Apache License 2.0
Project Creator : zlt2000
/**
* Rocketmq事务 demo
*
* @author zlt
*/
@EnableTransactionManagement
@SpringBootApplication
public clreplaced RocketMqTxApplication {
public static void main(String[] args) {
SpringApplication.run(RocketMqTxApplication.clreplaced, args);
}
}
18
View Source File : MybatisConfig.java
License : Apache License 2.0
Project Creator : zhoutaoo
License : Apache License 2.0
Project Creator : zhoutaoo
@EnableTransactionManagement
@Configuration
public clreplaced MybatisConfig {
/**
* 初使化Mybatis审计字段自动赋值的interceptor
*/
@Bean
public ISqlInjector sqlInjector() {
return new LogicSqlInjector();
}
/**
* 分页插件
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}
18
View Source File : MybatisConfig.java
License : Apache License 2.0
Project Creator : zhoutaoo
License : Apache License 2.0
Project Creator : zhoutaoo
/**
* 初使化Mybatis审计字段自动赋值的interceptor
*/
@EnableTransactionManagement
@Configuration
public clreplaced MybatisConfig {
/**
* 分页插件
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}
18
View Source File : XATransactionManagerConfig.java
License : GNU Affero General Public License v3.0
Project Creator : zhouhuan751312
License : GNU Affero General Public License v3.0
Project Creator : zhouhuan751312
/**
* <p>JTA 事务配置</p>
*
* @author: zhouzhou
* @date: 2020-04-16 16:29
* @web: http://www.j2eefast.com
* @version: 1.0.1
*/
@Configuration
@EnableTransactionManagement
public clreplaced XATransactionManagerConfig {
@Bean
public UserTransaction userTransaction() throws Throwable {
UserTransactionImp userTransactionImp = new UserTransactionImp();
userTransactionImp.setTransactionTimeout(10000);
return userTransactionImp;
}
@Bean(initMethod = "init", destroyMethod = "close")
public TransactionManager atomikosTransactionManager() {
UserTransactionManager userTransactionManager = new UserTransactionManager();
userTransactionManager.setForceShutdown(false);
return userTransactionManager;
}
@Bean
public PlatformTransactionManager transactionManager(UserTransaction userTransaction, TransactionManager transactionManager) {
return new JtaTransactionManager(userTransaction, transactionManager);
}
}
18
View Source File : MybatisPlusConfig.java
License : Apache License 2.0
Project Creator : ZHENFENG13
License : Apache License 2.0
Project Creator : ZHENFENG13
/**
* @qq交流群 796794009
* @qq 1320291471
* @Description: mybatis-plus配置
* @create 2020/12/27
*/
@EnableTransactionManagement
@Configuration
public clreplaced MybatisPlusConfig {
/**
* 分页插件
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}
18
View Source File : Application.java
License : MIT License
Project Creator : Zealon159
License : MIT License
Project Creator : Zealon159
/**
* 启动类
*/
@SpringBootApplication
@EnableTransactionManagement
public clreplaced Application {
public static void main(String[] args) {
SpringApplication.run(Application.clreplaced, args);
}
}
18
View Source File : XmallAdminApplication.java
License : MIT License
Project Creator : yzsunlei
License : MIT License
Project Creator : yzsunlei
/**
* 应用启动入口
* Created by macro on 2018/4/26.
*/
@SpringBootApplication
@MapperScan({ "com.yzsunlei.xmall.db.mapper", "com.yzsunlei.xmall.admin.dao" })
@EnableTransactionManagement
public clreplaced XmallAdminApplication {
public static void main(String[] args) {
SpringApplication.run(XmallAdminApplication.clreplaced, args);
}
}
18
View Source File : MybatisPlusConfig.java
License : GNU General Public License v3.0
Project Creator : ywhs
License : GNU General Public License v3.0
Project Creator : ywhs
/**
* CreateTime: 2018-12-18 20:39
* ClreplacedName: MybatisPlusConfig
* Package: com.ywh.common.config
* Describe:
* MybatisPlus的配置类
*
* @author YWH
*/
@EnableTransactionManagement
@Configuration
public clreplaced MybatisPlusConfig {
/**
* 分页插件
* @return
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
return new PaginationInterceptor();
}
}
18
View Source File : TransactionalApp.java
License : Apache License 2.0
Project Creator : xuwujing
License : Apache License 2.0
Project Creator : xuwujing
/**
* @replacedle: App
* @Description:
* 主程序入口
* @Version:1.0.0
* @author pancm
* @date 2018年1月9日
*/
@EnableTransactionManagement
@SpringBootApplication
public clreplaced TransactionalApp {
public static void main(String[] args) {
SpringApplication.run(TransactionalApp.clreplaced, args);
System.out.println("Transactional 程序正在运行...");
}
}
18
View Source File : App.java
License : Apache License 2.0
Project Creator : x-ream
License : Apache License 2.0
Project Creator : x-ream
@SpringBootApplication()
@EnableTransactionManagement
@EnableReadOnly
// @EnableX7L2Caching(timeSeconds = 300)
@EnableX7Repository(baseTypeSupported = true, mappingPrefix = "t_", mappingSpec = "_")
@EnableReyClient
@EnableTracingServlet
@EnableDateToLongForJackson
@EnableDistributionLock
@EnableFallbackOnly
@EnableCorsConfig("${access.domain}")
@EnableRateLimiter
public clreplaced App {
public static void main(String[] args) {
SpringApplication.run(App.clreplaced);
}
}
18
View Source File : SpringBootMongodbApplication.java
License : Apache License 2.0
Project Creator : WinterChenS
License : Apache License 2.0
Project Creator : WinterChenS
@SpringBootApplication
@EnableTransactionManagement
public clreplaced SpringBootMongodbApplication {
public static void main(String[] args) {
SpringApplication.run(SpringBootMongodbApplication.clreplaced, args);
}
}
18
View Source File : CoreBeanConfig.java
License : Apache License 2.0
Project Creator : WeBankFinTech
License : Apache License 2.0
Project Creator : WeBankFinTech
/**
* BeanConfig registers system common beans.
*
* @author maojiayu
* @data Dec 28, 2018 5:07:41 PM
*/
@Configuration
@EnableTransactionManagement
public clreplaced CoreBeanConfig {
/**
* Beetl render template.
*
* @return GroupTemplate
* @throws IOException
*/
@Bean
public static GroupTemplate getGroupTEmplateInstance() throws IOException {
ClreplacedpathResourceLoader resourceLoader = new ClreplacedpathResourceLoader("");
org.beetl.core.Configuration cfg = org.beetl.core.Configuration.defaultConfiguration();
GroupTemplate gt = new GroupTemplate(resourceLoader, cfg);
return gt;
}
@Bean
public static Credentials getCredentials() {
return GenCredential.create();
}
}
18
View Source File : CoreBeanConfig.java
License : Apache License 2.0
Project Creator : WeBankBlockchain
License : Apache License 2.0
Project Creator : WeBankBlockchain
/**
* BeanConfig registers system common beans.
*
* @author maojiayu
* @data Dec 28, 2018 5:07:41 PM
*/
@Configuration
@EnableTransactionManagement
public clreplaced CoreBeanConfig {
/**
* Beetl render template.
*
* @return GroupTemplate
* @throws IOException
*/
@Bean
public static GroupTemplate getGroupTEmplateInstance() throws IOException {
ClreplacedpathResourceLoader resourceLoader = new ClreplacedpathResourceLoader("");
org.beetl.core.Configuration cfg = org.beetl.core.Configuration.defaultConfiguration();
GroupTemplate gt = new GroupTemplate(resourceLoader, cfg);
return gt;
}
}
18
View Source File : MybatisConfiguration.java
License : Apache License 2.0
Project Creator : u014427391
License : Apache License 2.0
Project Creator : u014427391
/**
* <pre>
* Mybatis配置类
* </pre>
*
* @author nicky
* <pre>
* 修改记录
* 修改后版本: 修改人: 修改日期: 2019年12月15日 修改内容:
* </pre>
*/
@Configuration
@EnableTransactionManagement
@MapperScan(basePackages = { "com.example.springboot.jwt.mapper" })
public clreplaced MybatisConfiguration {
// 配置支持驼峰命名和大小写自动转换
@Bean
public ConfigurationCustomizer configurationCustomizer() {
return new ConfigurationCustomizer() {
@Override
public void customize(org.apache.ibatis.session.Configuration configuration) {
configuration.setMapUnderscoreToCamelCase(true);
}
};
}
}
18
View Source File : MybatisPlusConfig.java
License : Apache License 2.0
Project Creator : tysxquan
License : Apache License 2.0
Project Creator : tysxquan
/**
* @author sxquan
*/
@EnableTransactionManagement
@Configuration
public clreplaced MybatisPlusConfig {
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
// 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求 默认false
// paginationInterceptor.setOverflow(false);
// 设置最大单页限制数量,默认 500 条,-1 不受限制
// paginationInterceptor.setLimit(500);
List<ISqlParser> sqlParserList = new ArrayList<>();
// 攻击 SQL 阻断解析器、加入解析链
sqlParserList.add(new BlockAttackSqlParser());
paginationInterceptor.setSqlParserList(sqlParserList);
// 开启 count 的 join 优化,只针对部分 left join
paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true));
return paginationInterceptor;
}
}
18
View Source File : CommonConfig.java
License : GNU Lesser General Public License v3.0
Project Creator : tronprotocol
License : GNU Lesser General Public License v3.0
Project Creator : tronprotocol
@Configuration
@EnableTransactionManagement
@EnableAspectJAutoProxy
@ComponentScan(basePackages = "org.tron")
public clreplaced CommonConfig {
}
18
View Source File : DataJpaApplication.java
License : Apache License 2.0
Project Creator : tedburner
License : Apache License 2.0
Project Creator : tedburner
@EnableTransactionManagement
@SpringBootApplication
public clreplaced DataJpaApplication {
public static void main(String[] args) {
SpringApplication.run(DataJpaApplication.clreplaced, args);
}
}
18
View Source File : DatabaseConfig.java
License : MIT License
Project Creator : taowenyin
License : MIT License
Project Creator : taowenyin
@Configuration
@EnableTransactionManagement
@ComponentScan(basePackages = { "siso.edu.cn.dao", "siso.edu.cn.enreplacedy", "siso.edu.cn.service" })
public clreplaced DatabaseConfig {
/*==========数据源设置==========*/
@Bean
public DataSource dataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClreplacedName("com.mysql.cj.jdbc.Driver");
dataSource.setUrl("jdbc:mysql://localhost:3306/electric_iot?useSSL=true&serverTimezone=Asia/Shanghai&autoReconnect=true&useUnicode=true&characterEncoding=UTF-8");
dataSource.setUsername("root");
dataSource.setPreplacedword("05200902");
return dataSource;
}
private Properties databaseProperties() {
Properties properties = new Properties();
properties.setProperty(AvailableSettings.DIALECT, "org.hibernate.dialect.MySQL5Dialect");
properties.setProperty(AvailableSettings.SHOW_SQL, "true");
properties.setProperty(AvailableSettings.FORMAT_SQL, "true");
properties.setProperty(AvailableSettings.INTERCEPTOR, DeviceLocationInterceptor.clreplaced.getName());
return properties;
}
/*==========Hibernate设置==========*/
// @Bean
// public LocalSessionFactoryBean sessionFactory() {
// LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
//
// sessionFactory.setDataSource(dataSource());
// sessionFactory.setPackagesToScan("siso.edu.cn.enreplacedy");
// sessionFactory.setHibernateProperties(databaseProperties());
//
// return sessionFactory;
// }
// @Bean
// public HibernateTransactionManager transactionManager() {
// HibernateTransactionManager transactionManager = new HibernateTransactionManager();
// transactionManager.setSessionFactory(sessionFactory().getObject());
//
// return transactionManager;
// }
/*==========JPA设置==========*/
@Bean
public LocalContainerEnreplacedyManagerFactoryBean enreplacedyManagerFactoryBean(DataSource dataSource, JpaVendorAdapter jpaVendorAdapter) {
LocalContainerEnreplacedyManagerFactoryBean localContainerEnreplacedyManagerFactoryBean = new LocalContainerEnreplacedyManagerFactoryBean();
localContainerEnreplacedyManagerFactoryBean.setDataSource(dataSource);
localContainerEnreplacedyManagerFactoryBean.setJpaVendorAdapter(jpaVendorAdapter);
localContainerEnreplacedyManagerFactoryBean.setJpaProperties(databaseProperties());
localContainerEnreplacedyManagerFactoryBean.setPackagesToScan("siso.edu.cn.enreplacedy");
return localContainerEnreplacedyManagerFactoryBean;
}
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
adapter.setDatabase(Database.MYSQL);
adapter.setShowSql(true);
adapter.setGenerateDdl(false);
adapter.setDatabasePlatform("org.hibernate.dialect.MySQL5Dialect");
return adapter;
}
@Bean
public JpaTransactionManager jpaTransactionManager(EnreplacedyManagerFactory enreplacedyManagerFactory) {
JpaTransactionManager jpaTransactionManager = new JpaTransactionManager();
jpaTransactionManager.setEnreplacedyManagerFactory(enreplacedyManagerFactory);
return jpaTransactionManager;
}
@Bean
public PersistenceAnnotationBeanPostProcessor persistenceAnnotationBeanPostProcessor() {
return new PersistenceAnnotationBeanPostProcessor();
}
/*==========使Repository能够捕获异常==========*/
@Bean
public BeanPostProcessor persistenceTranslation() {
return new PersistenceExceptionTranslationPostProcessor();
}
}
18
View Source File : TxConfig.java
License : Apache License 2.0
Project Creator : SourceHot
License : Apache License 2.0
Project Creator : SourceHot
@ComponentScan(basePackages = "org.source.hot.spring.overview.ioc.tx.declarative")
@EnableTransactionManagement
public clreplaced TxConfig {
// 数据源
@Bean
public DataSource dataSource() {
DruidDataSource dataSource = new DruidDataSource();
dataSource.setUsername("huifer");
dataSource.setPreplacedword("a12345");
dataSource.setUrl("jdbc:mysql://47.98.225.144:3306/scrum?useSSL=false");
dataSource.setDriverClreplacedName(com.mysql.jdbc.Driver.clreplaced.getName());
return dataSource;
}
@Bean
public JdbcTemplate jdbcTemplate(DataSource dataSource) {
return new JdbcTemplate(dataSource);
}
// 事务管理器
@Bean
public PlatformTransactionManager platformTransactionManager(DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
}
18
View Source File : AccountXAApplication.java
License : Apache License 2.0
Project Creator : seata
License : Apache License 2.0
Project Creator : seata
@EnableTransactionManagement
@SpringBootApplication
public clreplaced AccountXAApplication {
public static void main(String[] args) {
SpringApplication.run(AccountXAApplication.clreplaced, args);
}
}
18
View Source File : IotApplication.java
License : MIT License
Project Creator : qmdx00
License : MIT License
Project Creator : qmdx00
/**
* @author yuanweimin
* @date 19/06/10 10:25
* @description 项目启动类
*/
@SpringBootApplication
@EnableTransactionManagement
public clreplaced IotApplication {
public static void main(String[] args) {
SpringApplication.run(IotApplication.clreplaced);
}
}
18
View Source File : DatabaseConfiguration.java
License : GNU General Public License v3.0
Project Creator : popeen
License : GNU General Public License v3.0
Project Creator : popeen
@Configuration
@EnableTransactionManagement
public clreplaced DatabaseConfiguration {
@Bean
public DataSourceTransactionManager transactionManager(DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
@Bean
@Profile("legacy")
@DependsOn("liquibase")
public DaoHelper legacyDaoHelper(DataSource dataSource) {
return new LegacyHsqlDaoHelper(dataSource);
}
@Bean
@ConditionalOnMissingBean
@DependsOn("liquibase")
public DaoHelper daoHelper(DataSource dataSource) {
return new GenericDaoHelper(dataSource);
}
@Bean
@Profile("legacy")
public DataSource legacyDataSource() {
BasicDataSource dataSource = new BasicDataSource();
dataSource.setDriverClreplacedName("org.hsqldb.jdbcDriver");
dataSource.setUrl(SettingsService.getDefaultJDBCUrl());
dataSource.setUsername(SettingsService.getDefaultJDBCUsername());
dataSource.setPreplacedword(SettingsService.getDefaultJDBCPreplacedword());
return dataSource;
}
@Bean
@Profile("embed")
public DataSource embedDataSource(@Value("${DatabaseConfigEmbedDriver}") String driver, @Value("${DatabaseConfigEmbedUrl}") String url, @Value("${DatabaseConfigEmbedUsername}") String username, @Value("${DatabaseConfigEmbedPreplacedword}") String preplacedword) {
BasicDataSource basicDataSource = new BasicDataSource();
basicDataSource.setDriverClreplacedName(driver);
basicDataSource.setUrl(url);
basicDataSource.setUsername(username);
basicDataSource.setPreplacedword(preplacedword);
return basicDataSource;
}
@Bean
@Profile("jndi")
public DataSource jndiDataSource(@Value("${DatabaseConfigJNDIName}") String jndiName) {
JndiDataSourceLookup jndiLookup = new JndiDataSourceLookup();
return jndiLookup.getDataSource(jndiName);
}
@Bean
public File rollbackFile() {
return new File(SettingsService.getAirsonicHome(), "rollback.sql");
}
@Bean
public String userTableQuote(@Value("${DatabaseUsertableQuote:}") String value) {
return value;
}
@Bean
public SpringLiquibase liquibase(DataSource dataSource, @Value("${DatabaseMysqlMaxlength:512}") String mysqlVarcharLimit, String userTableQuote) {
SpringLiquibase springLiquibase = new SpringLiquibase();
springLiquibase.setDataSource(dataSource);
springLiquibase.setChangeLog("clreplacedpath:liquibase/db-changelog.xml");
springLiquibase.setRollbackFile(rollbackFile());
Map<String, String> parameters = new HashMap<>();
parameters.put("defaultMusicFolder", Util.getDefaultMusicFolder());
parameters.put("mysqlVarcharLimit", mysqlVarcharLimit);
parameters.put("userTableQuote", userTableQuote);
springLiquibase.setChangeLogParameters(parameters);
return springLiquibase;
}
}
18
View Source File : MigrationConfiguration.java
License : Apache License 2.0
Project Creator : pleuvoir
License : Apache License 2.0
Project Creator : pleuvoir
@Configuration
@EnableTransactionManagement
public clreplaced MigrationConfiguration {
@ConfigurationProperties(prefix = "flyway")
@Bean("flyway")
public Flyway getFlyway(DataSource dataSource) {
Flyway flyway = new Flyway();
flyway.setDataSource(dataSource);
return flyway;
}
}
18
View Source File : HiberBootApplication.java
License : MIT License
Project Creator : PacktPublishing
License : MIT License
Project Creator : PacktPublishing
@SpringBootApplication(exclude = JpaRepositoriesAutoConfiguration.clreplaced)
@EnableTransactionManagement
public clreplaced HiberBootApplication extends SpringBootServletInitializer {
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(HiberBootApplication.clreplaced);
}
public static void main(String[] args) throws Exception {
SpringApplication.run(HiberBootApplication.clreplaced, args);
}
}
18
View Source File : InfrastructureConfig.java
License : MIT License
Project Creator : PacktPublishing
License : MIT License
Project Creator : PacktPublishing
/**
* @author Dinesh.Rajput
*/
@Configuration
@EnableTransactionManagement
public clreplaced InfrastructureConfig {
// have infrastructure related beans like DataSource, JNDI, etc.
@Bean
public DataSource dataSource() {
// in-memory
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.H2);
builder.addScript("schema.sql");
builder.addScript("data.sql");
return builder.build();
}
@Bean
public LocalSessionFactoryBean sessionFactory(DataSource dataSource) {
LocalSessionFactoryBean sfb = new LocalSessionFactoryBean();
sfb.setDataSource(dataSource);
sfb.setPackagesToScan(new String[] { "com.packt.patterninspring.chapter8.bankapp.model" });
Properties props = new Properties();
props.setProperty("dialect", "org.hibernate.dialect.H2Dialect");
sfb.setHibernateProperties(props);
return sfb;
}
// implementation
@Bean
public PlatformTransactionManager transactionManager(SessionFactory sessionFactory) {
return new HibernateTransactionManager(sessionFactory);
}
}
18
View Source File : InfrastructureConfig.java
License : MIT License
Project Creator : PacktPublishing
License : MIT License
Project Creator : PacktPublishing
/**
* @author Dinesh.Rajput
*/
@Configuration
@EnableTransactionManagement
public clreplaced InfrastructureConfig {
// have infrastructure related beans like DataSource, JNDI, etc.
@Bean
public DataSource dataSource() {
// in-memory
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.H2);
builder.addScript("schema.sql");
builder.addScript("data.sql");
return builder.build();
}
// implementation
@Bean
public PlatformTransactionManager transactionManager() {
return new DataSourceTransactionManager(dataSource());
}
}
18
View Source File : AppConfig.java
License : MIT License
Project Creator : PacktPublishing
License : MIT License
Project Creator : PacktPublishing
@Configuration
@EnableTransactionManagement
public clreplaced AppConfig {
@Bean
public DataSource dataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClreplacedName("org.postgresql.Driver");
dataSource.setUrl("jdbc:postgresql://localhost:5432/TestDB");
dataSource.setUsername("test");
dataSource.setPreplacedword("test");
return dataSource;
}
@Bean
public JdbcTemplate jdbcTemplate() {
JdbcTemplate jdbcTemplate = new JdbcTemplate();
jdbcTemplate.setDataSource(dataSource());
return jdbcTemplate;
}
@Bean
public AccountDao accountDao() {
AccountDaoImpl accountDao = new AccountDaoImpl();
accountDao.setJdbcTemplate(jdbcTemplate());
return accountDao;
}
@Bean
public PlatformTransactionManager transactionManager() {
DataSourceTransactionManager transactionManager = new DataSourceTransactionManager();
transactionManager.setDataSource(dataSource());
return transactionManager;
}
}
18
View Source File : SpringMvcDatabaseConfig.java
License : MIT License
Project Creator : PacktPublishing
License : MIT License
Project Creator : PacktPublishing
@Configuration
@EnableTransactionManagement
public clreplaced SpringMvcDatabaseConfig {
@Bean
public NamedParameterJdbcTemplate jdbcTemplate() throws PropertyVetoException, SQLException {
return new NamedParameterJdbcTemplate(dataSource());
}
@Bean
public DataSource dataSource() throws PropertyVetoException, SQLException {
EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();
EmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.H2).addScript("schema.sql").addScript("users.sql").addScript("authorities.sql").build();
return db;
}
@Bean
public PlatformTransactionManager transactionManager() throws PropertyVetoException, SQLException {
return new DataSourceTransactionManager(dataSource());
}
}
18
View Source File : DataConfig.java
License : Apache License 2.0
Project Creator : PaaS-TA
License : Apache License 2.0
Project Creator : PaaS-TA
/**
* paastaDeliveryPipelineApi
* paasta.delivery.pipeline.scheduler.config
*
* @author REX
* @version 1.0
* @since 9/6/2017
*/
@Configuration
@EnableTransactionManagement
public clreplaced DataConfig {
/**
* Transaction manager platform transaction manager.
*
* @param dataSource the data source
* @return the platform transaction manager
*/
@Bean
PlatformTransactionManager transactionManager(DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
}
18
View Source File : DataSourceConfig.java
License : Apache License 2.0
Project Creator : PaaS-TA
License : Apache License 2.0
Project Creator : PaaS-TA
/**
* paastaDeliveryPipelineApi
* paasta.delivery.pipeline.common.api.config
*
* @author REX
* @version 1.0
* @since 9/19/2017
*/
@Configuration
@EnableTransactionManagement
public clreplaced DataSourceConfig {
/**
* Transaction manager platform transaction manager.
*
* @param dataSource the data source
* @return the platform transaction manager
*/
@Bean
PlatformTransactionManager transactionManager(DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
}
18
View Source File : InfrastructureConfiguration.java
License : Apache License 2.0
Project Creator : odrotbohm
License : Apache License 2.0
Project Creator : odrotbohm
@Configuration(proxyBeanMethods = false)
@EnableTransactionManagement
clreplaced InfrastructureConfiguration {
@Bean
LocalContainerEnreplacedyManagerFactoryBean enreplacedyManagerFactory(DataSource dataSource) {
HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
adapter.setDatabase(Database.HSQL);
adapter.setGenerateDdl(true);
LocalContainerEnreplacedyManagerFactoryBean factoryBean = new LocalContainerEnreplacedyManagerFactoryBean();
factoryBean.setDataSource(dataSource);
factoryBean.setJpaVendorAdapter(adapter);
factoryBean.setPackagesToScan("org.springframework.events.jpa");
return factoryBean;
}
@Bean
DataSource dataSource() {
return new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.HSQL).build();
}
@Bean
JpaTransactionManager transactionManager(EnreplacedyManagerFactory factory) {
return new JpaTransactionManager(factory);
}
}
18
View Source File : InfrastructureConfiguration.java
License : Apache License 2.0
Project Creator : odrotbohm
License : Apache License 2.0
Project Creator : odrotbohm
@Configuration(proxyBeanMethods = false)
@EnableTransactionManagement
clreplaced InfrastructureConfiguration {
@Bean
LocalContainerEnreplacedyManagerFactoryBean enreplacedyManagerFactory(DataSource dataSource) {
HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
adapter.setDatabase(Database.HSQL);
adapter.setGenerateDdl(true);
LocalContainerEnreplacedyManagerFactoryBean factoryBean = new LocalContainerEnreplacedyManagerFactoryBean();
factoryBean.setDataSource(dataSource);
factoryBean.setJpaVendorAdapter(adapter);
factoryBean.setPackagesToScan("org.moduliths.events.jpa");
return factoryBean;
}
@Bean
DataSource dataSource() {
return new EmbeddedDatabaseBuilder().setType(EmbeddedDatabaseType.HSQL).build();
}
@Bean
JpaTransactionManager transactionManager(EnreplacedyManagerFactory factory) {
return new JpaTransactionManager(factory);
}
}
18
View Source File : MybatisPlusConfig.java
License : MIT License
Project Creator : netyjq
License : MIT License
Project Creator : netyjq
/**
* mybatis plus config
* more detail see https://github.com/baomidou/mybatis-plus
* @date 2019/12/13
* @author [email protected]
*/
@EnableTransactionManagement
@Configuration
public clreplaced MybatisPlusConfig {
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
// 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求 默认false
// paginationInterceptor.setOverflow(false);
// 设置最大单页限制数量,默认 500 条,-1 不受限制
// paginationInterceptor.setLimit(500);
return paginationInterceptor;
}
}
18
View Source File : MyBatisConfig.java
License : Apache License 2.0
Project Creator : macrozheng
License : Apache License 2.0
Project Creator : macrozheng
/**
* MyBatis相关配置
* Created by macro on 2019/4/8.
*/
@Configuration
@EnableTransactionManagement
@MapperScan({ "com.macro.mall.mapper", "com.macro.mall.portal.dao" })
public clreplaced MyBatisConfig {
}
18
View Source File : MybatisPlusConfig.java
License : Apache License 2.0
Project Creator : luoyusoft
License : Apache License 2.0
Project Creator : luoyusoft
/**
* @Description: MybatisPlus配置类
* @Author: jinhaoxun
* @Date: 2020/2/13 上午11:34
* @Version: 1.0.0
*/
@EnableTransactionManagement
@Configuration
public clreplaced MybatisPlusConfig {
/**
* mybatis-plus SQL执行效率插件【生产环境可以关闭】,设置 dev test 环境开启
*/
// @Bean
// @Profile({"dev", "qa"})
// public PerformanceInterceptor performanceInterceptor() {
// PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
// performanceInterceptor.setMaxTime(1000);
// performanceInterceptor.setFormat(true);
// return performanceInterceptor;
// }
/**
* 分页插件
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
// 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求 默认false
paginationInterceptor.setOverflow(false);
// 设置最大单页限制数量,默认 500 条,-1 不受限制
paginationInterceptor.setLimit(500);
// 开启 count 的 join 优化,只针对部分 left join
paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true));
return paginationInterceptor;
}
}
18
View Source File : FastDepAtomikosTransactionConfigure.java
License : Apache License 2.0
Project Creator : louislivi
License : Apache License 2.0
Project Creator : louislivi
/**
* FastDepAtomikosTransactionConfigure
*
* @author : louislivi
*/
@EnableTransactionManagement
@ConditionalOnClreplaced(TransactionManager.clreplaced)
public clreplaced FastDepAtomikosTransactionConfigure {
/**
* atomikosTransactionManager
*
* @return userTransactionManager
*/
@Bean(name = "atomikosTransactionManager", initMethod = "init", destroyMethod = "close")
public TransactionManager atomikosTransactionManager() {
UserTransactionManager userTransactionManager = new UserTransactionManager();
userTransactionManager.setForceShutdown(false);
return userTransactionManager;
}
/**
* PlatformTransactionManager
*
* @return PlatformTransactionManager
* @throws Throwable throwable
*/
@Bean(name = "txManager")
@DependsOn({ "userTransaction", "atomikosTransactionManager" })
public PlatformTransactionManager transactionManager() throws Throwable {
UserTransaction userTransaction = userTransaction();
TransactionManager atomikosTransactionManager = atomikosTransactionManager();
return new JtaTransactionManager(userTransaction, atomikosTransactionManager);
}
/**
* userTransaction
*
* @return userTransactionImp
* @throws Throwable throwable
*/
@Bean(name = "userTransaction")
public UserTransaction userTransaction() throws Throwable {
UserTransactionImp userTransactionImp = new UserTransactionImp();
userTransactionImp.setTransactionTimeout(10000);
return userTransactionImp;
}
}
18
View Source File : JPAConfig.java
License : Apache License 2.0
Project Creator : linnykoleh
License : Apache License 2.0
Project Creator : linnykoleh
@Configuration
@EnableTransactionManagement
public clreplaced JPAConfig {
@Bean
public LocalContainerEnreplacedyManagerFactoryBean enreplacedyManagerFactory(DataSource dataSource) {
LocalContainerEnreplacedyManagerFactoryBean em = new LocalContainerEnreplacedyManagerFactoryBean();
em.setDataSource(dataSource);
em.setPackagesToScan("com.ps.bk.hotel.customer.model");
em.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
em.setJpaProperties(additionalProperties());
return em;
}
@Bean
public PlatformTransactionManager transactionManager(EnreplacedyManagerFactory emf) {
JpaTransactionManager transactionManager = new JpaTransactionManager();
transactionManager.setEnreplacedyManagerFactory(emf);
return transactionManager;
}
private Properties additionalProperties() {
Properties properties = new Properties();
properties.setProperty("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect");
return properties;
}
}
18
View Source File : MyBatisConfiguration.java
License : Apache License 2.0
Project Creator : LinkedBear
License : Apache License 2.0
Project Creator : LinkedBear
// @Configuration
@ComponentScan("com.linkedbear.spring.mybatis")
@EnableTransactionManagement
public clreplaced MyBatisConfiguration {
@Bean
public DataSource dataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClreplacedName("com.mysql.jdbc.Driver");
dataSource.setUrl("jdbc:mysql://localhost:dao/spring-webmvc?characterEncoding=utf8");
dataSource.setUsername("root");
dataSource.setPreplacedword("123456");
return dataSource;
}
@Bean
public TransactionManager transactionManager(DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
@Bean
public SqlSessionFactoryBean sqlSessionFactoryBean(DataSource dataSource) {
SqlSessionFactoryBean sqlSessionFactoryBean = new SqlSessionFactoryBean();
sqlSessionFactoryBean.setDataSource(dataSource);
sqlSessionFactoryBean.setConfigLocation(new ClreplacedPathResource("clreplacedpath:mybatis/SqlMapConfig.xml"));
return sqlSessionFactoryBean;
}
@Bean
public SqlSessionTemplate sqlSessionTemplate(SqlSessionFactory sqlSessionFactory) {
return new SqlSessionTemplate(sqlSessionFactory);
}
@Bean
public MapperFactoryBean<DepartmentMapper> departmentMapper(SqlSessionFactory sqlSessionFactory) {
MapperFactoryBean<DepartmentMapper> departmentMapperFactoryBean = new MapperFactoryBean<>();
departmentMapperFactoryBean.setMapperInterface(DepartmentMapper.clreplaced);
departmentMapperFactoryBean.setSqlSessionFactory(sqlSessionFactory);
return departmentMapperFactoryBean;
}
@Bean
public MapperScannerConfigurer mapperScannerConfigurer() {
MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
mapperScannerConfigurer.setBasePackage("com.linkedbear.spring.mybatis.mapper");
mapperScannerConfigurer.setSqlSessionFactoryBeanName("sqlSessionFactory");
return mapperScannerConfigurer;
}
}
18
View Source File : JdbcDaoConfiguration.java
License : Apache License 2.0
Project Creator : LinkedBear
License : Apache License 2.0
Project Creator : LinkedBear
@Configuration
@EnableTransactionManagement
public clreplaced JdbcDaoConfiguration {
@Bean
public DataSource dataSource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClreplacedName("com.mysql.jdbc.Driver");
dataSource.setUrl("jdbc:mysql://localhost:3306/spring-webmvc?characterEncoding=utf8");
dataSource.setUsername("root");
dataSource.setPreplacedword("123456");
return dataSource;
}
@Bean
public JdbcTemplate jdbcTemplate(DataSource dataSource) {
return new JdbcTemplate(dataSource);
}
@Bean
public TransactionManager transactionManager(DataSource dataSource) {
return new DataSourceTransactionManager(dataSource);
}
}
18
View Source File : TransactionManagementConfiguration.java
License : MIT License
Project Creator : leecho
License : MIT License
Project Creator : leecho
/**
* 默认事务配置
* @author LIQIU
*/
@Configuration
@EnableTransactionManagement
public clreplaced TransactionManagementConfiguration {
}
18
View Source File : MybatisConfig.java
License : Apache License 2.0
Project Creator : KeRan213539
License : Apache License 2.0
Project Creator : KeRan213539
/**
* @author klw(213539 @ qq.com)
* @ClreplacedName: MybatisConfig
* @Description: Mybatis配制
* @date 2019/8/8 11:27
*/
@EnableTransactionManagement
@Configuration
public clreplaced MybatisConfig {
/**
* 分页插件
*/
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
// paginationInterceptor.setLimit(你的最大单页限制数量,默认 500 条,小于 0 如 -1 不受限制);
return paginationInterceptor;
}
}
18
View Source File : TestConfig.java
License : Apache License 2.0
Project Creator : katharsis-project
License : Apache License 2.0
Project Creator : katharsis-project
@Configuration
@EnableTransactionManagement
@ComponentScan({ "io.kartharsis" })
public clreplaced TestConfig {
@Bean
public EnreplacedyManager enreplacedyManager(EnreplacedyManagerFactory enreplacedyManagerFactory) {
return enreplacedyManagerFactory.createEnreplacedyManager();
}
@Bean
public SpringTransactionRunner transactionRunner() {
return new SpringTransactionRunner();
}
@Bean
public EnreplacedyManagerProducer enreplacedyManagerProducer() {
return new EnreplacedyManagerProducer();
}
@Bean
public LocalContainerEnreplacedyManagerFactoryBean getLocalContainerEnreplacedyManagerFactoryBean() {
LocalContainerEnreplacedyManagerFactoryBean bean = new LocalContainerEnreplacedyManagerFactoryBean();
bean.setJpaProperties(hibernateProperties());
bean.setPackagesToScan(TestEnreplacedy.clreplaced.getPackage().getName());
bean.setDataSource(testDataSource());
bean.setPersistenceUnitName("TEST");
return bean;
}
@Bean
public LocalSessionFactoryBean sessionFactory() {
LocalSessionFactoryBean sessionFactory = new LocalSessionFactoryBean();
sessionFactory.setDataSource(testDataSource());
sessionFactory.setPackagesToScan(new String[] { TestEnreplacedy.clreplaced.getPackage().getName() });
sessionFactory.setHibernateProperties(hibernateProperties());
return sessionFactory;
}
@Bean
public DataSource testDataSource() {
JdbcDataSource dataSource = new JdbcDataSource();
dataSource.setUrl("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=TRUE");
dataSource.setUser("sa");
return dataSource;
}
@Bean
public PlatformTransactionManager transactionManager(final EnreplacedyManagerFactory emf) {
final JpaTransactionManager transactionManager = new JpaTransactionManager();
transactionManager.setEnreplacedyManagerFactory(emf);
transactionManager.setDataSource(testDataSource());
return transactionManager;
}
@Bean
public PersistenceExceptionTranslationPostProcessor exceptionTranslation() {
return new PersistenceExceptionTranslationPostProcessor();
}
private Properties hibernateProperties() {
Properties props = new Properties();
props.setProperty("hibernate.hbm2ddl.auto", "create");
props.setProperty("hibernate.dialect", H2Dialect.clreplaced.getName());
props.setProperty("hibernate.globally_quoted_identifiers", "true");
return props;
}
}
18
View Source File : SpringbootQuerydslApplication.java
License : Apache License 2.0
Project Creator : kaimz
License : Apache License 2.0
Project Creator : kaimz
@SpringBootApplication
@EnableTransactionManagement
public clreplaced SpringbootQuerydslApplication {
public static void main(String[] args) {
SpringApplication.run(SpringbootQuerydslApplication.clreplaced, args);
}
}
18
View Source File : MyBatisConfig.java
License : MIT License
Project Creator : jskillcloud
License : MIT License
Project Creator : jskillcloud
@Configuration
@EnableTransactionManagement
public clreplaced MyBatisConfig {
}
18
View Source File : Server.java
License : Apache License 2.0
Project Creator : jigsaw-projects
License : Apache License 2.0
Project Creator : jigsaw-projects
/**
* 启动RPC服务器,使用spring boot application。
*/
@EnableTransactionManagement
@SpringBootApplication
public clreplaced Server {
/**
* 通过SpringApplication来启动RpCServer。 RPCServer配置在Jigsaw-thrift-protobuf项目中。
* @param args 参考Spring boot 的启动参数说明。
* @throws Exception
*/
public static void main(String[] args) throws Exception {
SpringApplication.run(Server.clreplaced, args);
}
}
18
View Source File : SpringDataJpa.java
License : MIT License
Project Creator : JavaZakariae
License : MIT License
Project Creator : JavaZakariae
/**
* 1• What is a Repository interface?
* 2• How do you define a Repository interface? Why is it an interface not a clreplaced?
* 3• What is the naming convention for finder methods in a Repository interface?
* 4• How are Spring Data repositories implemented by Spring at runtime?
* 5• What is @Query used for?
*
* 1• A repository interface need no implementation to guarantee the crud operations.
* They are already implemented by spring data jpa, we can implement our own query by adding more method tp the interface.
* 2• Extends from a Repository. Interfaces allow to use proxy object to intercept calls.
* 3• @todo example to make
* 4• https://stackoverflow.com/questions/38509882/how-are-spring-data-repositories-actually-implemented
* Jdk proxy intercepts method calls.
* 5• to specify a query to be used in the repository.
*/
@Import(MyConfiguration.clreplaced)
@EnableTransactionManagement
@EnableJpaRepositories(basePackageClreplacedes = { PersonRepository.clreplaced, ProfessionRepository.clreplaced })
@ComponentScan(basePackageClreplacedes = { MyService.clreplaced, MyController.clreplaced })
public clreplaced SpringDataJpa {
/**
* The way we run this application is only for testing purpose and should not be used like that.
* @param args
*/
public static void main(String[] args) {
ApplicationContext applicationContext = new AnnotationConfigApplicationContext(SpringDataJpa.clreplaced);
MyController controller = applicationContext.getBean(MyController.clreplaced);
controller.init();
controller.testAllRelations();
controller.printPersonsList();
}
}
18
View Source File : EnablingTransaction.java
License : MIT License
Project Creator : JavaZakariae
License : MIT License
Project Creator : JavaZakariae
@EnableTransactionManagement
@Configuration
clreplaced MyConfiguration {
/**
* defining a transaction manager
* @return
*/
@Bean
public PlatformTransactionManager transactionManager() {
return new DataSourceTransactionManager(datasource());
}
/**
* defining a datasource
* @return
*/
public DataSource datasource() {
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setUsername("");
return dataSource;
}
}
18
View Source File : MybatisPlusConfigure.java
License : Apache License 2.0
Project Creator : JacksonTu
License : Apache License 2.0
Project Creator : JacksonTu
/**
* @Description MybatisPlus配置类
* @Author JacksonTu
* @Date 2018/11/13 20:18
*/
@EnableTransactionManagement
@Configuration
public clreplaced MybatisPlusConfigure {
/**
* 新的分页插件,一缓和二缓遵循mybatis的规则,需要设置 MybatisConfiguration#useDeprecatedExecutor = false 避免缓存出现问题
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
@Bean
public ConfigurationCustomizer configurationCustomizer() {
return configuration -> configuration.setUseDeprecatedExecutor(false);
}
}
18
View Source File : BrightDataSourceAutoConfigure.java
License : Apache License 2.0
Project Creator : JacksonTu
License : Apache License 2.0
Project Creator : JacksonTu
/**
* @author JacksonTu
* @version 1.0
* @description
* @since 2020-08-10 20:30
*/
@Configuration
@EnableTransactionManagement
public clreplaced BrightDataSourceAutoConfigure {
/**
* 注册数据权限
*/
@Bean
@Order(-1)
public DataPermissionInterceptor dataPermissionInterceptor() {
return new DataPermissionInterceptor();
}
/**
* 注册分页插件
* 新的分页插件,一缓和二缓遵循mybatis的规则,需要设置 MybatisConfiguration#useDeprecatedExecutor = false 避免缓存出现问题
*/
@Bean
@Order(-2)
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
@Bean
@Order(-3)
public ConfigurationCustomizer configurationCustomizer() {
return configuration -> configuration.setUseDeprecatedExecutor(false);
}
}
18
View Source File : MybatisPlusConfig.java
License : Apache License 2.0
Project Creator : huifer
License : Apache License 2.0
Project Creator : huifer
@Configuration
@EnableTransactionManagement
public clreplaced MybatisPlusConfig {
@Bean
public OptimisticLockerInterceptor optimisticLockerInterceptor() {
return new OptimisticLockerInterceptor();
}
@Bean
public PaginationInterceptor paginationInterceptor() {
PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
// 设置请求的页面大于最大页后操作, true调回到首页,false 继续请求 默认false
// paginationInterceptor.setOverflow(false);
// 设置最大单页限制数量,默认 500 条,-1 不受限制
// paginationInterceptor.setLimit(500);
// 开启 count 的 join 优化,只针对部分 left join
paginationInterceptor.setCountSqlParser(new JsqlParserCountOptimize(true));
return paginationInterceptor;
}
}
See More Examples