Browse Source
* commit 'c066969f5a85cc01cdd400f0e3322b97675136f5': fix fix fix MOBILE-17909&MOBILE-17908 10.0微信》定时调度有微信任务时卸载微信插件,报错research/11.0
ju
6 years ago
2 changed files with 46 additions and 1 deletions
@ -0,0 +1,40 @@
|
||||
package com.fr.third.org.hibernate.tuple.entity; |
||||
|
||||
import java.util.Map; |
||||
import java.util.concurrent.ConcurrentHashMap; |
||||
|
||||
/** |
||||
* Created by Zed on 2018/11/1. |
||||
*/ |
||||
public class DefaultEntityRegister { |
||||
|
||||
private static volatile DefaultEntityRegister instance; |
||||
private static Map<Class, Class> MAP = new ConcurrentHashMap<Class, Class>(); |
||||
|
||||
public static DefaultEntityRegister getInstance() { |
||||
if (instance == null) { |
||||
synchronized (DefaultEntityRegister.class) { |
||||
if (instance == null) { |
||||
instance = new DefaultEntityRegister(); |
||||
} |
||||
} |
||||
} |
||||
return instance; |
||||
} |
||||
|
||||
private DefaultEntityRegister() { |
||||
|
||||
} |
||||
|
||||
public void registerDefaultClass(Class abstractEntityClass, Class defaultEntityClass) { |
||||
MAP.put(abstractEntityClass, defaultEntityClass); |
||||
} |
||||
|
||||
public void removeDefaultClass(Class abstractEntityClass) { |
||||
MAP.remove(abstractEntityClass); |
||||
} |
||||
|
||||
public Class getDefaultEntityClass(Class abstractEntityClass) { |
||||
return MAP.get(abstractEntityClass); |
||||
} |
||||
} |
Loading…
Reference in new issue