GORA-239 Add null checks and better message in AccumuloStore (David Medinets via hsaputra)

git-svn-id: https://svn.apache.org/repos/asf/gora/branches/GORA_174@1490480 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/CHANGES.txt b/CHANGES.txt
index 44ef09f..7856895 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -4,7 +4,10 @@
 
 Gora Change Log
 
-trunk (current development)
+* GORA-239 Add null checks and better message in AccumuloStore (David Medinets via hsaputra)
+
+0.3 release: 05/03/2013 (mm/dd/yyyy)
+Release Report: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12311172&version=12317954Gora Change Log
 
 * GORA-191 Support multiple Avro Schemas within GoraCompiler (Udesh Liyanaarachchi, rmarroquin, lewismc) 
 
diff --git a/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java b/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java
index 3937171..4fabf7b 100644
--- a/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java
+++ b/gora-accumulo/src/main/java/org/apache/gora/accumulo/store/AccumuloStore.java
@@ -93,6 +93,7 @@
 import org.apache.gora.store.DataStoreFactory;
 import org.apache.gora.store.impl.DataStoreBase;
 import org.apache.gora.util.AvroUtils;
+import org.apache.gora.util.GoraException;
 import org.apache.hadoop.io.Text;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -322,6 +323,10 @@
         }
 
       }
+
+      if (mapping.tableName == null) {
+        throw new GoraException("Please define the gora to accumulo mapping in " + filename + " for " + persistentClass.getCanonicalName());
+      }
       
       nl = root.getElementsByTagName("table");
       for (int i = 0; i < nl.getLength(); i++) {
@@ -536,6 +541,11 @@
         
         Object o = val.get(i);
         Pair<Text,Text> col = mapping.fieldMap.get(field.name());
+
+        if (col == null) {
+          throw new GoraException("Please define the gora to accumulo mapping for field " + field.name());
+        }
+
   
         switch (field.schema().getType()) {
           case MAP: