Refactored GenericDelegator:
1. Converted GenericDelegator to an interface. We already have DelegatorInterface, but it isn't being used anywhere. Removed DelegatorInterface.java. 2. Extracted the static, cached data from the GenericDelegator implementation and put it in its own class - DelegatorData. The GenericDelegator implementation holds a reference to the DelegatorData instance. This makes it possible to have per-thread instances of GenericDelegator. 3. Replaced the ThreadLocal variables with regular variables. ThreadLocal variables are no longer needed. Client code doesn't need to be concerned with pushing and popping the GenericDelegator state. This commit paves the way for the forthcoming ExecutionContext. User modifications will have to replace GenericDelegator.getGenericDelegator(...) with DelegatorFactory.getGenericDelegator(...). Also, replace the push code with the new setXxx methods, and remove the pop code. If modifications used DelegatorInterface, replace that with GenericDelegator. Aside from those changes, this commit is backwards compatible. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@802567 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.ofbiz.entity;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javolution.util.FastMap;
|
||||
|
||||
import org.ofbiz.base.util.Debug;
|
||||
import org.ofbiz.entity.cache.Cache;
|
||||
import org.ofbiz.entity.config.DelegatorInfo;
|
||||
import org.ofbiz.entity.config.EntityConfigUtil;
|
||||
import org.ofbiz.entity.eca.EntityEcaHandler;
|
||||
import org.ofbiz.entity.model.ModelGroupReader;
|
||||
import org.ofbiz.entity.model.ModelReader;
|
||||
import org.ofbiz.entity.util.DistributedCacheClear;
|
||||
import org.ofbiz.entity.util.EntityCrypto;
|
||||
import org.ofbiz.entity.util.SequenceUtil;
|
||||
|
||||
/** Data source for the DelegatorImpl Class. */
|
||||
public class DelegatorData implements Cloneable {
|
||||
|
||||
public static final String module = DelegatorData.class.getName();
|
||||
/**
|
||||
* the delegatorDataCache will now be a HashMap, allowing reload of
|
||||
* definitions, but the delegator will always be the same object for the
|
||||
* given name
|
||||
*/
|
||||
protected static final Map<String, DelegatorData> delegatorDataCache = FastMap.newInstance();
|
||||
|
||||
/**
|
||||
* keeps a list of field key sets used in the by and cache, a Set (of Sets
|
||||
* of fieldNames) for each entityName
|
||||
*/
|
||||
protected Map<?, ?> andCacheFieldSets = FastMap.newInstance();
|
||||
protected Cache cache = null;
|
||||
protected EntityCrypto crypto = null;
|
||||
protected DelegatorInfo delegatorInfo = null;
|
||||
protected String delegatorName = null;
|
||||
protected DistributedCacheClear distributedCacheClear = null;
|
||||
protected EntityEcaHandler<?> entityEcaHandler = null;
|
||||
protected ModelGroupReader modelGroupReader = null;
|
||||
protected ModelReader modelReader = null;
|
||||
protected String originalDelegatorName = null;
|
||||
protected SequenceUtil sequencer = null;
|
||||
protected boolean initialized = false;
|
||||
|
||||
public static synchronized DelegatorData getInstance(String delegatorName) throws GenericEntityException {
|
||||
if (delegatorName == null) {
|
||||
delegatorName = "default";
|
||||
Debug.logWarning(new Exception("Location where getting delegator with null name"), "Got a getGenericDelegator call with a null delegatorName, assuming \"default\" for the name.", module);
|
||||
}
|
||||
DelegatorData delegatorData = delegatorDataCache.get(delegatorName);
|
||||
if (delegatorData == null) {
|
||||
if (Debug.infoOn()) {
|
||||
Debug.logInfo("Creating new delegator data instance [" + delegatorName + "] (" + Thread.currentThread().getName() + ")", module);
|
||||
}
|
||||
delegatorData = new DelegatorData(delegatorName);
|
||||
delegatorDataCache.put(delegatorName, delegatorData);
|
||||
}
|
||||
return delegatorData;
|
||||
}
|
||||
|
||||
/** Only allow creation through the factory method */
|
||||
protected DelegatorData() {
|
||||
}
|
||||
|
||||
/** Only allow creation through the factory method */
|
||||
protected DelegatorData(String delegatorName) throws GenericEntityException {
|
||||
this.delegatorName = delegatorName;
|
||||
this.originalDelegatorName = delegatorName;
|
||||
this.modelReader = ModelReader.getModelReader(delegatorName);
|
||||
this.modelGroupReader = ModelGroupReader.getModelGroupReader(delegatorName);
|
||||
this.cache = new Cache(delegatorName);
|
||||
this.delegatorInfo = EntityConfigUtil.getDelegatorInfo(this.delegatorName);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object clone() {
|
||||
DelegatorData delegatorData = new DelegatorData();
|
||||
delegatorData.modelReader = this.modelReader;
|
||||
delegatorData.modelGroupReader = this.modelGroupReader;
|
||||
delegatorData.delegatorName = this.delegatorName;
|
||||
delegatorData.delegatorInfo = this.delegatorInfo;
|
||||
delegatorData.cache = this.cache;
|
||||
delegatorData.andCacheFieldSets = this.andCacheFieldSets;
|
||||
delegatorData.distributedCacheClear = this.distributedCacheClear;
|
||||
delegatorData.originalDelegatorName = this.originalDelegatorName;
|
||||
delegatorData.entityEcaHandler = this.entityEcaHandler;
|
||||
delegatorData.sequencer = this.sequencer;
|
||||
delegatorData.crypto = this.crypto;
|
||||
return delegatorData;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.ofbiz.entity;
|
||||
|
||||
import org.ofbiz.base.util.Debug;
|
||||
|
||||
/** GenericDelegator Factory Class. */
|
||||
public class DelegatorFactory {
|
||||
|
||||
public static final String module = DelegatorFactory.class.getName();
|
||||
|
||||
public static GenericDelegator getGenericDelegator(String delegatorName) {
|
||||
if (delegatorName == null) {
|
||||
delegatorName = "default";
|
||||
Debug.logWarning(new Exception("Location where getting delegator with null name"), "Got a getGenericDelegator call with a null delegatorName, assuming default for the name.", module);
|
||||
}
|
||||
DelegatorData delegatorData = null;
|
||||
try {
|
||||
delegatorData = DelegatorData.getInstance(delegatorName);
|
||||
} catch (GenericEntityException e) {
|
||||
Debug.logError(e, "Could not create delegator with name \"" + delegatorName + "\": ", module);
|
||||
}
|
||||
if (delegatorData != null) {
|
||||
return new DelegatorImpl(delegatorData);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,236 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*******************************************************************************/
|
||||
package org.ofbiz.entity;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.ofbiz.entity.cache.Cache;
|
||||
import org.ofbiz.entity.condition.EntityCondition;
|
||||
import org.ofbiz.entity.datasource.GenericHelper;
|
||||
import org.ofbiz.entity.model.ModelEntity;
|
||||
import org.ofbiz.entity.model.ModelFieldType;
|
||||
import org.ofbiz.entity.model.ModelGroupReader;
|
||||
import org.ofbiz.entity.model.ModelReader;
|
||||
import org.ofbiz.entity.util.EntityFindOptions;
|
||||
import org.ofbiz.entity.util.EntityListIterator;
|
||||
import org.ofbiz.entity.util.SequenceUtil;
|
||||
|
||||
/**
|
||||
* Delegator Interface
|
||||
*/
|
||||
public interface DelegatorInterface {
|
||||
|
||||
String getDelegatorName();
|
||||
|
||||
ModelReader getModelReader();
|
||||
|
||||
ModelGroupReader getModelGroupReader();
|
||||
|
||||
ModelEntity getModelEntity(String entityName);
|
||||
|
||||
String getEntityGroupName(String entityName);
|
||||
|
||||
Map<String, ModelEntity> getModelEntityMapByGroup(String groupName) throws GenericEntityException;
|
||||
|
||||
String getGroupHelperName(String groupName);
|
||||
|
||||
String getEntityHelperName(String entityName);
|
||||
|
||||
String getEntityHelperName(ModelEntity entity);
|
||||
|
||||
GenericHelper getEntityHelper(String entityName) throws GenericEntityException;
|
||||
|
||||
GenericHelper getEntityHelper(ModelEntity entity) throws GenericEntityException;
|
||||
|
||||
ModelFieldType getEntityFieldType(ModelEntity entity, String type) throws GenericEntityException;
|
||||
|
||||
Collection<String> getEntityFieldTypeNames(ModelEntity entity) throws GenericEntityException;
|
||||
|
||||
GenericValue makeValue(String entityName);
|
||||
|
||||
GenericValue makeValue(String entityName, Object... fields);
|
||||
|
||||
GenericValue makeValue(String entityName, Map<String, ? extends Object> fields);
|
||||
|
||||
GenericValue makeValueSingle(String entityName, Object singlePkValue);
|
||||
|
||||
GenericValue makeValidValue(String entityName, Object... fields);
|
||||
|
||||
GenericValue makeValidValue(String entityName, Map<String, ? extends Object> fields);
|
||||
|
||||
GenericPK makePK(String entityName);
|
||||
|
||||
GenericPK makePK(String entityName, Object... fields);
|
||||
|
||||
GenericPK makePK(String entityName, Map<String, ? extends Object> fields);
|
||||
|
||||
GenericPK makePKSingle(String entityName, Object singlePkValue);
|
||||
|
||||
GenericValue create(String entityName, Object... fields) throws GenericEntityException;
|
||||
|
||||
GenericValue create(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException;
|
||||
|
||||
GenericValue createSingle(String entityName, Object singlePkValue) throws GenericEntityException;
|
||||
|
||||
GenericValue create(GenericValue value) throws GenericEntityException;
|
||||
|
||||
GenericValue create(GenericValue value, boolean doCacheClear) throws GenericEntityException;
|
||||
|
||||
GenericValue create(GenericPK primaryKey) throws GenericEntityException;
|
||||
|
||||
GenericValue create(GenericPK primaryKey, boolean doCacheClear) throws GenericEntityException;
|
||||
|
||||
GenericValue createOrStore(GenericValue value, boolean doCacheClear) throws GenericEntityException;
|
||||
|
||||
GenericValue createOrStore(GenericValue value) throws GenericEntityException;
|
||||
|
||||
GenericValue findOne(String entityName, Map<String, ? extends Object> fields, boolean useCache) throws GenericEntityException;
|
||||
|
||||
GenericValue findByPrimaryKey(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException;
|
||||
|
||||
GenericValue findByPrimaryKeyCache(String entityName, Object... fields) throws GenericEntityException;
|
||||
|
||||
GenericValue findByPrimaryKeyCache(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException;
|
||||
|
||||
GenericValue findByPrimaryKeyPartial(GenericPK primaryKey, Set<String> keys) throws GenericEntityException;
|
||||
|
||||
int removeByPrimaryKey(GenericPK primaryKey) throws GenericEntityException;
|
||||
|
||||
int removeByPrimaryKey(GenericPK primaryKey, boolean doCacheClear) throws GenericEntityException;
|
||||
|
||||
int removeValue(GenericValue value) throws GenericEntityException;
|
||||
|
||||
int removeValue(GenericValue value, boolean doCacheClear) throws GenericEntityException;
|
||||
|
||||
List<GenericValue> findByAnd(String entityName, Object... fields) throws GenericEntityException;
|
||||
|
||||
List<GenericValue> findByAnd(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException;
|
||||
|
||||
List<GenericValue> findByAnd(String entityName, Map<String, ? extends Object> fields, List<String> orderBy) throws GenericEntityException;
|
||||
|
||||
//List<GenericValue> findByAnd(ModelEntity modelEntity, Map<String, ? extends Object> fields, List<String> orderBy) throws GenericEntityException;
|
||||
|
||||
List<GenericValue> findByOr(String entityName, Map<String, ? extends Object> fields, List<String> orderBy) throws GenericEntityException;
|
||||
|
||||
List<GenericValue> findByAndCache(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException;
|
||||
|
||||
List<GenericValue> findByAndCache(String entityName, Map<String, ? extends Object> fields, List<String> orderBy) throws GenericEntityException;
|
||||
|
||||
EntityListIterator find(String entityName, EntityCondition whereEntityCondition,
|
||||
EntityCondition havingEntityCondition, Set<String> fieldsToSelect, List<String> orderBy, EntityFindOptions findOptions)
|
||||
throws GenericEntityException;
|
||||
|
||||
List<GenericValue> findList(String entityName, EntityCondition entityCondition,
|
||||
Set<String> fieldsToSelect, List<String> orderBy, EntityFindOptions findOptions, boolean useCache)
|
||||
throws GenericEntityException;
|
||||
|
||||
int removeByAnd(String entityName, Object... fields) throws GenericEntityException;
|
||||
|
||||
int removeByAnd(String entityName, Map<String, ? extends Object> fields) throws GenericEntityException;
|
||||
|
||||
int removeByAnd(String entityName, boolean doCacheClear, Object... fields) throws GenericEntityException;
|
||||
|
||||
int removeByAnd(String entityName, Map<String, ? extends Object> fields, boolean doCacheClear) throws GenericEntityException;
|
||||
|
||||
int removeByCondition(String entityName, EntityCondition condition) throws GenericEntityException;
|
||||
|
||||
int removeByCondition(String entityName, EntityCondition condition, boolean doCacheClear) throws GenericEntityException;
|
||||
|
||||
List<GenericValue> getMultiRelation(GenericValue value, String relationNameOne, String relationNameTwo, List<String> orderBy) throws GenericEntityException;
|
||||
|
||||
List<GenericValue> getRelated(String relationName, Map<String, ? extends Object> byAndFields, List<String> orderBy, GenericValue value) throws GenericEntityException;
|
||||
|
||||
GenericPK getRelatedDummyPK(String relationName, Map<String, ? extends Object> byAndFields, GenericValue value) throws GenericEntityException;
|
||||
|
||||
List<GenericValue> getRelatedCache(String relationName, GenericValue value) throws GenericEntityException;
|
||||
|
||||
GenericValue getRelatedOne(String relationName, GenericValue value) throws GenericEntityException;
|
||||
|
||||
GenericValue getRelatedOneCache(String relationName, GenericValue value) throws GenericEntityException;
|
||||
|
||||
int removeRelated(String relationName, GenericValue value) throws GenericEntityException;
|
||||
|
||||
int removeRelated(String relationName, GenericValue value, boolean doCacheClear) throws GenericEntityException;
|
||||
|
||||
void refresh(GenericValue value) throws GenericEntityException;
|
||||
|
||||
void refresh(GenericValue value, boolean doCacheClear) throws GenericEntityException;
|
||||
|
||||
int store(GenericValue value) throws GenericEntityException;
|
||||
|
||||
int store(GenericValue value, boolean doCacheClear) throws GenericEntityException;
|
||||
|
||||
int storeAll(List<GenericValue> values) throws GenericEntityException;
|
||||
|
||||
int storeAll(List<GenericValue> values, boolean doCacheClear) throws GenericEntityException;
|
||||
|
||||
int storeByCondition(String entityName, Map<String, ? extends Object> fieldsToSet, EntityCondition condition) throws GenericEntityException;
|
||||
|
||||
int storeByCondition(String entityName, Map<String, ? extends Object> fieldsToSet, EntityCondition condition, boolean doCacheClear) throws GenericEntityException;
|
||||
|
||||
int removeAll(String entityName) throws GenericEntityException;
|
||||
|
||||
int removeAll(List<? extends GenericEntity> dummyPKs) throws GenericEntityException;
|
||||
|
||||
int removeAll(List<? extends GenericEntity> dummyPKs, boolean doCacheClear) throws GenericEntityException;
|
||||
|
||||
void clearAllCaches();
|
||||
|
||||
void clearAllCaches(boolean distribute);
|
||||
|
||||
void clearCacheLine(String entityName);
|
||||
|
||||
void clearCacheLine(String entityName, Object... fields);
|
||||
|
||||
void clearCacheLine(String entityName, Map<String, ? extends Object> fields);
|
||||
|
||||
void clearCacheLineFlexible(GenericEntity dummyPK);
|
||||
|
||||
void clearCacheLineFlexible(GenericEntity dummyPK, boolean distribute);
|
||||
|
||||
void clearCacheLine(GenericPK primaryKey);
|
||||
|
||||
void clearCacheLine(GenericPK primaryKey, boolean distribute);
|
||||
|
||||
void clearCacheLine(GenericValue value);
|
||||
|
||||
void clearCacheLine(GenericValue value, boolean distribute);
|
||||
|
||||
void clearCacheLineByCondition(String entityName, EntityCondition condition);
|
||||
|
||||
void clearAllCacheLinesByDummyPK(Collection<GenericPK> dummyPKs);
|
||||
|
||||
void clearAllCacheLinesByValue(Collection<GenericValue> values);
|
||||
|
||||
GenericValue getFromPrimaryKeyCache(GenericPK primaryKey);
|
||||
|
||||
String getNextSeqId(String seqName);
|
||||
String getNextSeqId(String seqName, long staggerMax);
|
||||
Long getNextSeqIdLong(String seqName);
|
||||
Long getNextSeqIdLong(String seqName, long staggerMax);
|
||||
|
||||
void setSequencer(SequenceUtil sequencer);
|
||||
|
||||
void refreshSequencer();
|
||||
|
||||
Cache getCache();
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -285,7 +285,7 @@ public class GenericEntity extends Observable implements Map<String, Object>, Lo
|
||||
public GenericDelegator getDelegator() {
|
||||
if (internalDelegator == null) {
|
||||
if (delegatorName == null) delegatorName = "default";
|
||||
if (delegatorName != null) internalDelegator = GenericDelegator.getGenericDelegator(delegatorName);
|
||||
if (delegatorName != null) internalDelegator = DelegatorFactory.getGenericDelegator(delegatorName);
|
||||
if (internalDelegator == null) {
|
||||
throw new IllegalStateException("[GenericEntity.getDelegator] could not find delegator with name " + delegatorName);
|
||||
}
|
||||
@@ -300,7 +300,7 @@ public class GenericEntity extends Observable implements Map<String, Object>, Lo
|
||||
this.internalDelegator = internalDelegator;
|
||||
}
|
||||
|
||||
public Object get(String name) {
|
||||
protected Object getFieldValue(String name) {
|
||||
if (getModelEntity().getField(name) == null) {
|
||||
throw new IllegalArgumentException("[GenericEntity.get] \"" + name + "\" is not a field of " + entityName);
|
||||
}
|
||||
@@ -696,7 +696,7 @@ public class GenericEntity extends Observable implements Map<String, Object>, Lo
|
||||
public Object get(String name, String resource, Locale locale) {
|
||||
Object fieldValue = null;
|
||||
try {
|
||||
fieldValue = get(name);
|
||||
fieldValue = getFieldValue(name);
|
||||
} catch (IllegalArgumentException e) {
|
||||
if (Debug.verboseOn()) {
|
||||
Debug.logVerbose(e, "The field name (or key) [" + name + "] is not valid for entity [" + this.getEntityName() + "], printing IllegalArgumentException instead of throwing it because Map interface specification does not allow throwing that exception.", module);
|
||||
@@ -754,7 +754,7 @@ public class GenericEntity extends Observable implements Map<String, Object>, Lo
|
||||
while (iter != null && iter.hasNext()) {
|
||||
ModelField curField = iter.next();
|
||||
keyBuffer.append('.');
|
||||
keyBuffer.append(this.get(curField.getName()));
|
||||
keyBuffer.append(this.getFieldValue(curField.getName()));
|
||||
}
|
||||
|
||||
String bundleKey = keyBuffer.toString();
|
||||
@@ -1337,7 +1337,7 @@ public class GenericEntity extends Observable implements Map<String, Object>, Lo
|
||||
|
||||
public Object get(Object key) {
|
||||
try {
|
||||
return this.get((String) key);
|
||||
return this.get((String)key, this.getDelegator().getLocale());
|
||||
} catch (IllegalArgumentException e) {
|
||||
if (Debug.verboseOn()) {
|
||||
Debug.logVerbose(e, "The field name (or key) [" + key + "] is not valid for entity [" + this.getEntityName() + "], printing IllegalArgumentException instead of throwing it because Map interface specification does not allow throwing that exception.", module);
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package org.ofbiz.entity.cache;
|
||||
|
||||
import org.ofbiz.base.util.cache.UtilCache;
|
||||
import org.ofbiz.entity.DelegatorFactory;
|
||||
import org.ofbiz.entity.GenericDelegator;
|
||||
|
||||
public abstract class AbstractCache<K, V> {
|
||||
@@ -31,7 +32,7 @@ public abstract class AbstractCache<K, V> {
|
||||
}
|
||||
|
||||
public GenericDelegator getDelegator() {
|
||||
return GenericDelegator.getGenericDelegator(delegatorName);
|
||||
return DelegatorFactory.getGenericDelegator(delegatorName);
|
||||
}
|
||||
|
||||
public void remove(String entityName) {
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.ofbiz.base.util.Debug;
|
||||
import org.ofbiz.base.util.ObjectType;
|
||||
import org.ofbiz.base.util.UtilValidate;
|
||||
import org.ofbiz.entity.EntityCryptoException;
|
||||
import org.ofbiz.entity.DelegatorFactory;
|
||||
import org.ofbiz.entity.GenericDelegator;
|
||||
import org.ofbiz.entity.GenericEntity;
|
||||
import org.ofbiz.entity.GenericEntityException;
|
||||
@@ -251,7 +252,7 @@ public class EntityExpr extends EntityCondition {
|
||||
if (delegator == null) {
|
||||
// this will be the common case for now as the delegator isn't available where we want to do this
|
||||
// we'll cheat a little here and assume the default delegator
|
||||
delegator = GenericDelegator.getGenericDelegator("default");
|
||||
delegator = DelegatorFactory.getGenericDelegator("default");
|
||||
}
|
||||
|
||||
String fieldName = null;
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.ofbiz.base.util.UtilValidate;
|
||||
import org.ofbiz.base.util.UtilXml;
|
||||
import org.ofbiz.base.util.collections.FlexibleMapAccessor;
|
||||
import org.ofbiz.base.util.string.FlexibleStringExpander;
|
||||
import org.ofbiz.entity.DelegatorFactory;
|
||||
import org.ofbiz.entity.GenericDelegator;
|
||||
import org.ofbiz.entity.GenericEntityException;
|
||||
import org.ofbiz.entity.GenericValue;
|
||||
@@ -136,7 +137,7 @@ public abstract class ListFinder extends Finder {
|
||||
resultSetType = ResultSet.TYPE_FORWARD_ONLY;
|
||||
|
||||
if (delegatorName != null && delegatorName.length() > 0) {
|
||||
delegator = GenericDelegator.getGenericDelegator(delegatorName);
|
||||
delegator = DelegatorFactory.getGenericDelegator(delegatorName);
|
||||
}
|
||||
|
||||
EntityCondition whereEntityCondition = getWhereEntityCondition(context, modelEntity, delegator.getModelFieldTypeReader(modelEntity));
|
||||
|
||||
Reference in New Issue
Block a user