Author: pranayp
Date: Sat May 21 10:30:36 2016
New Revision: 1744892
URL:
http://svn.apache.org/viewvc?rev=1744892&view=revLog:
[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/trunk/framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java?rev=1744892&r1=1744891&r2=1744892&view=diff==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/engine/EntityAutoEngine.java Sat May 21 10:30:36 2016
@@ -228,6 +228,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 ****