All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.yhy.jakit.starter.dynamic.datasource.jpa.holder.JPANameHolder Maven / Gradle / Ivy

There is a newer version: 1.0.3
Show newest version
package com.yhy.jakit.starter.dynamic.datasource.jpa.holder;

import com.alibaba.ttl.TransmittableThreadLocal;

/**
 * Created on 2021-05-25 15:39
 *
 * @author 颜洪毅
 * @version 1.0.0
 * @since 1.0.0
 */
public class JPANameHolder {
    private final static ThreadLocal TL = new TransmittableThreadLocal<>();

    public static void set(String dsName) {
        TL.set(dsName);
    }

    public static String get() {
        return TL.get();
    }

    public static void clear() {
        TL.remove();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy