From 2733ad456c3b00471ea3cbbc9bfb0f4145ef66be Mon Sep 17 00:00:00 2001 From: Martin Taal Date: Thu, 22 Nov 2012 23:09:04 +0100 Subject: Make sure that the product has a unique name, for the hibernate store --- .../org/eclipse/emf/cdo/tests/model1/impl/Model1FactoryImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'plugins/org.eclipse.emf.cdo.tests.model1') diff --git a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1FactoryImpl.java b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1FactoryImpl.java index d522133a5f..63e5b45c2a 100644 --- a/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1FactoryImpl.java +++ b/plugins/org.eclipse.emf.cdo.tests.model1/src/org/eclipse/emf/cdo/tests/model1/impl/Model1FactoryImpl.java @@ -62,6 +62,8 @@ public class Model1FactoryImpl extends EFactoryImpl implements Model1Factory return new Model1FactoryImpl(); } + private int productCounter = 0; + /** * Creates an instance of the factory. * @@ -208,8 +210,10 @@ public class Model1FactoryImpl extends EFactoryImpl implements Model1Factory { VAT result = VAT.get(initialValue); if (result == null) + { throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + } return result; } @@ -234,11 +238,12 @@ public class Model1FactoryImpl extends EFactoryImpl implements Model1Factory /** * - * @generated + * @generated NOT */ public Product1 createProduct1() { Product1Impl product1 = new Product1Impl(); + product1.setName(productCounter++ + ""); return product1; } -- cgit v1.2.3