本文整理汇总了Java中org.ofbiz.entity.datasource.GenericHelperFactory类的典型用法代码示例。如果您正苦于以下问题:Java GenericHelperFactory类的具体用法?Java GenericHelperFactory怎么用?Java GenericHelperFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GenericHelperFactory类属于org.ofbiz.entity.datasource包,在下文中一共展示了GenericHelperFactory类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeOneGenericHelper
import org.ofbiz.entity.datasource.GenericHelperFactory; //导入依赖的package包/类
private void initializeOneGenericHelper(String groupName) {
GenericHelperInfo helperInfo = this.getGroupHelperInfo(groupName);
if (helperInfo == null) {
if (Debug.infoOn()) {
Debug.logInfo("Delegator \"" + delegatorFullName + "\" NOT initializing helper for entity group \"" + groupName + "\" because the group is not associated to this delegator.", module);
}
return;
}
String helperBaseName = helperInfo.getHelperBaseName();
if (Debug.infoOn()) {
Debug.logInfo("Delegator \"" + delegatorFullName + "\" initializing helper \"" + helperBaseName + "\" for entity group \"" + groupName + "\".", module);
}
if (UtilValidate.isNotEmpty(helperInfo.getHelperFullName())) {
// pre-load field type defs, the return value is ignored
ModelFieldTypeReader.getModelFieldTypeReader(helperBaseName);
// get the helper and if configured, do the datasource check
GenericHelper helper = GenericHelperFactory.getHelper(helperInfo);
try {
Datasource datasource = EntityConfig.getDatasource(helperBaseName);
if (datasource.getCheckOnStart()) {
if (Debug.infoOn()) {
Debug.logInfo("Doing database check as requested in entityengine.xml with addMissing=" + datasource.getAddMissingOnStart(), module);
}
helper.checkDataSource(this.getModelEntityMapByGroup(groupName), null, datasource.getAddMissingOnStart());
}
} catch (GenericEntityException e) {
Debug.logWarning(e, e.getMessage(), module);
}
}
}
示例2: getEntityHelper
import org.ofbiz.entity.datasource.GenericHelperFactory; //导入依赖的package包/类
@Override
public GenericHelper getEntityHelper(String entityName) throws GenericEntityException {
GenericHelperInfo helperInfo = getEntityHelperInfo(entityName);
if (helperInfo != null) {
return GenericHelperFactory.getHelper(helperInfo);
} else {
throw new GenericEntityException("There is no datasource (Helper) configured for the entity-group [" + this.getEntityGroupName(entityName) + "]; was trying to find datasource (helper) for entity [" + entityName + "]");
}
}
示例3: initializeOneGenericHelper
import org.ofbiz.entity.datasource.GenericHelperFactory; //导入依赖的package包/类
private void initializeOneGenericHelper(String groupName) {
GenericHelperInfo helperInfo = this.getGroupHelperInfo(groupName);
if (helperInfo == null) {
if (Debug.infoOn()) {
Debug.logInfo("Delegator \"" + delegatorFullName + "\" NOT initializing helper for entity group \"" + groupName + "\" because the group is not associated to this delegator.", module);
}
return;
}
String helperBaseName = helperInfo.getHelperBaseName();
if (Debug.infoOn()) {
Debug.logInfo("Delegator \"" + delegatorFullName + "\" initializing helper \"" + helperBaseName + "\" for entity group \"" + groupName + "\".", module);
}
if (UtilValidate.isNotEmpty(helperInfo.getHelperFullName())) {
// pre-load field type defs, the return value is ignored
ModelFieldTypeReader.getModelFieldTypeReader(helperBaseName);
// get the helper and if configured, do the datasource check
GenericHelper helper = GenericHelperFactory.getHelper(helperInfo);
try {
Datasource datasource = EntityConfigUtil.getDatasource(helperBaseName);
if (datasource.getCheckOnStart()) {
if (Debug.infoOn()) {
Debug.logInfo("Doing database check as requested in entityengine.xml with addMissing=" + datasource.getAddMissingOnStart(), module);
}
helper.checkDataSource(this.getModelEntityMapByGroup(groupName), null, datasource.getAddMissingOnStart());
}
} catch (GenericEntityException e) {
Debug.logWarning(e, e.getMessage(), module);
}
}
}
示例4: getEntityHelper
import org.ofbiz.entity.datasource.GenericHelperFactory; //导入依赖的package包/类
public GenericHelper getEntityHelper(String entityName) throws GenericEntityException {
GenericHelperInfo helperInfo = getEntityHelperInfo(entityName);
if (helperInfo != null) {
return GenericHelperFactory.getHelper(helperInfo);
} else {
throw new GenericEntityException("There is no datasource (Helper) configured for the entity-group [" + this.getEntityGroupName(entityName) + "]; was trying to find datasource (helper) for entity [" + entityName + "]");
}
}