本文整理汇总了Java中org.ofbiz.entity.datasource.GenericHelperFactory.getHelper方法的典型用法代码示例。如果您正苦于以下问题:Java GenericHelperFactory.getHelper方法的具体用法?Java GenericHelperFactory.getHelper怎么用?Java GenericHelperFactory.getHelper使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.ofbiz.entity.datasource.GenericHelperFactory
的用法示例。
在下文中一共展示了GenericHelperFactory.getHelper方法的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 + "]");
}
}