|
|
@ -25,7 +25,7 @@ public class BeanRelation {
|
|
|
|
|
|
|
|
|
|
|
|
private static Map<Long, BeanRelation> relations = new ConcurrentHashMap<>();
|
|
|
|
private static Map<Long, BeanRelation> relations = new ConcurrentHashMap<>();
|
|
|
|
private static BeanRelation get() {
|
|
|
|
private static BeanRelation get() {
|
|
|
|
Long userId = 0l;
|
|
|
|
Long userId = 0L;
|
|
|
|
BeanRelation relation = relations.get(userId);
|
|
|
|
BeanRelation relation = relations.get(userId);
|
|
|
|
if (relation == null) {
|
|
|
|
if (relation == null) {
|
|
|
|
synchronized (BeanRelation.class) {
|
|
|
|
synchronized (BeanRelation.class) {
|
|
|
@ -383,6 +383,14 @@ public class BeanRelation {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
|
|
|
|
* 移除关联关系中的对象,并不会移除关联的对象的关系
|
|
|
|
|
|
|
|
* @param bean
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public static void erase(BaseBean bean) {
|
|
|
|
|
|
|
|
get().caches.get(bean.getClass()).remove(bean.getId());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 按指定路径,递归调用lambda表达式,当lambda表达式返回false或路径存在循环则退出递归。
|
|
|
|
* 按指定路径,递归调用lambda表达式,当lambda表达式返回false或路径存在循环则退出递归。
|
|
|
|
* @param bean
|
|
|
|
* @param bean
|
|
|
|
* @param fun
|
|
|
|
* @param fun
|
|
|
|