Author: pranayp
Date: Sat May 21 10:40:07 2016
New Revision: 1744896
URL: http://svn.apache.org/viewvc?rev=1744896&view=rev
Log:
Applied fix from trunk revision 1744892.
---------------------------------------------------------------------
[OFBIZ-7099] Fixed: Service entity auto not having duplicate record check when
we pass single primary key.
Thanks Amardeep Singh Jhajj for reporting the issue and providing patch.
---------------------------------------------------------------------
Modified:
ofbiz/branches/release14.12/framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java
Modified:
ofbiz/branches/release14.12/framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release14.12/framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java?rev=1744896&r1=1744895&r2=1744896&view=diff
==============================================================================
---
ofbiz/branches/release14.12/framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java
(original)
+++
ofbiz/branches/release14.12/framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java
Sat May 21 10:40:07 2016
@@ -192,6 +192,10 @@ public final class EntityAutoEngine exte
}
}
newEntity.set(singlePkModeField.getName(), pkValue);
+ GenericValue lookedUpValue =
PrimaryKeyFinder.runFind(modelEntity, parameters, dctx.getDelegator(), false,
true, null, null);
+ if (lookedUpValue != null) {
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ServiceValueFound", UtilMisc.toMap("pkFields",
newEntity.getPkShortValueString()), locale));
+ }
} else if (isDoublePk && doublePkPrimaryInParam != null &&
doublePkSecondaryOutParam != null) {
/*
**** secondary sequenced primary key ****