本文整理汇总了Java中org.ofbiz.entity.model.ModelEntityChecker类的典型用法代码示例。如果您正苦于以下问题:Java ModelEntityChecker类的具体用法?Java ModelEntityChecker怎么用?Java ModelEntityChecker使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ModelEntityChecker类属于org.ofbiz.entity.model包,在下文中一共展示了ModelEntityChecker类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GenericDelegator
import org.ofbiz.entity.model.ModelEntityChecker; //导入依赖的package包/类
/** Only allow creation through the factory method */
protected GenericDelegator(String delegatorFullName) throws GenericEntityException {
//if (Debug.infoOn()) Debug.logInfo("Creating new Delegator with name \"" + delegatorFullName + "\".", module);
this.setDelegatorNames(delegatorFullName);
this.delegatorInfo = EntityConfigUtil.getDelegator(delegatorBaseName);
String kekText;
// before continuing, if there is a tenantId use the base delegator to see if it is valid
if (UtilValidate.isNotEmpty(this.delegatorTenantId)) {
Delegator baseDelegator = DelegatorFactory.getDelegator(this.delegatorBaseName);
GenericValue tenant = baseDelegator.findOne("Tenant", true, "tenantId", this.delegatorTenantId);
if (tenant == null) {
throw new GenericEntityException("No Tenant record found for delegator [" + this.delegatorFullName + "] with tenantId [" + this.delegatorTenantId + "]");
} else if ("Y".equals(tenant.getString("disabled"))) {
throw new GenericEntityException("No Tenant record found for delegator [" + this.delegatorFullName + "] with tenantId [" + this.delegatorTenantId + "]");
}
GenericValue kekValue = baseDelegator.findOne("TenantKeyEncryptingKey", true, "tenantId", getDelegatorTenantId());
if (kekValue != null) {
kekText = kekValue.getString("kekText");
} else {
kekText = this.delegatorInfo.getKeyEncryptingKey();
}
} else {
kekText = this.delegatorInfo.getKeyEncryptingKey();
}
this.modelReader = ModelReader.getModelReader(delegatorBaseName);
this.modelGroupReader = ModelGroupReader.getModelGroupReader(delegatorBaseName);
cache = new Cache(delegatorFullName);
// do the entity model check
List<String> warningList = new LinkedList<String>();
Debug.logImportant("Doing entity definition check...", module);
ModelEntityChecker.checkEntities(this, warningList);
if (warningList.size() > 0) {
Debug.logWarning("=-=-=-=-= Found " + warningList.size() + " warnings when checking the entity definitions:", module);
for (String warning: warningList) {
Debug.logWarning(warning, module);
}
}
// initialize helpers by group
Set<String> groupNames = getModelGroupReader().getGroupNames(delegatorBaseName);
List<Future<Void>> futures = new LinkedList<Future<Void>>();
for (String groupName: groupNames) {
futures.add(ExecutionPool.GLOBAL_EXECUTOR.submit(createHelperCallable(groupName)));
}
ExecutionPool.getAllFutures(futures);
// NOTE: doing some things before the ECAs and such to make sure it is in place just in case it is used in a service engine startup thing or something
// setup the crypto class; this also after the delegator is in the cache otherwise we get infinite recursion
this.crypto = new EntityCrypto(this, kekText);
}