zed
6 years ago
2 changed files with 110 additions and 74 deletions
@ -0,0 +1,41 @@
|
||||
package com.fr.third.org.hibernate.tuple.entity; |
||||
|
||||
/** |
||||
* Created by Zed on 2018/11/1. |
||||
*/ |
||||
public class DefaultEntityRegister { |
||||
|
||||
private static volatile DefaultEntityRegister instance; |
||||
private Class defaultEntityClass = null; |
||||
|
||||
public static DefaultEntityRegister getInstance() { |
||||
if (instance == null) { |
||||
synchronized (DefaultEntityRegister.class) { |
||||
if (instance == null) { |
||||
instance = new DefaultEntityRegister(); |
||||
} |
||||
} |
||||
} |
||||
return instance; |
||||
} |
||||
|
||||
private DefaultEntityRegister() { |
||||
|
||||
} |
||||
|
||||
public void registerDefaultClass(Class defaultEntityClass) { |
||||
this.defaultEntityClass = defaultEntityClass; |
||||
} |
||||
|
||||
public void resetDefaultClass() { |
||||
this.defaultEntityClass = null; |
||||
} |
||||
|
||||
public Class getDefaultEntityClass() { |
||||
return defaultEntityClass; |
||||
} |
||||
|
||||
public void setDefaultEntityClass(Class defaultEntityClass) { |
||||
this.defaultEntityClass = defaultEntityClass; |
||||
} |
||||
} |
Loading…
Reference in new issue