details: https://code.openbravo.com/erp/devel/pi/rev/15a48f5b6cfe
changeset: 22661:15a48f5b6cfe
user: Shankar Balachandran <shankar.balachandran <at> openbravo.com>
date: Mon Mar 10 17:14:30 2014 +0530
summary: Fixes Issue 0025557: Is not possible to enter more than one
datasource table in ORACLE
Duplication error is not raised when the same record is being updated.
diffstat:
src/org/openbravo/event/ADTableEventHandler.java | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diffs (19 lines):
diff -r d8b34bab1751 -r 15a48f5b6cfe
src/org/openbravo/event/ADTableEventHandler.java
--- a/src/org/openbravo/event/ADTableEventHandler.java Mon Mar 10 09:33:09
2014 +0100
+++ b/src/org/openbravo/event/ADTableEventHandler.java Mon Mar 10 17:14:30
2014 +0530
@@ -75,6 +75,7 @@
private void checkClassNameForDuplicates(EntityPersistenceEvent event) {
ConnectionProvider conn = new DalConnectionProvider(false);
String language = OBContext.getOBContext().getLanguage().getLanguage();
+ String tableId = (String) event.getTargetInstance().getId();
final Entity tableEntity =
ModelProvider.getInstance().getEntity(Table.ENTITY_NAME);
final Property javaClassNameProperty =
tableEntity.getProperty(Table.PROPERTY_JAVACLASSNAME);
Object javaClassName = event.getCurrentState(javaClassNameProperty);
@@ -86,6 +87,7 @@
OBCriteria<Table> tableCriteria =
OBDal.getInstance().createCriteria(Table.class);
tableCriteria.add(Restrictions.eq(Table.PROPERTY_JAVACLASSNAME,
javaClassName));
tableCriteria.add(Restrictions.eq(Table.PROPERTY_DATAPACKAGE,
packageName));
+ tableCriteria.add(Restrictions.not(Restrictions.eq(Table.PROPERTY_ID,
tableId)));
if (tableCriteria.count() != 0) {
throw new OBException(Utility.messageBD(conn,
"DuplicateJavaClassName", language));
}
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits