full support for comment status in admin
[mir.git] / source / mir / entity / adapter / EntityAdapter.java
index 3897860..ba2dca1 100755 (executable)
@@ -99,7 +99,7 @@ public class EntityAdapter implements Map {
   }
 
   public boolean isEmpty() {
-    throw new UnsupportedOperationException("EntityAdapter.isEmpty()");
+    return false;
   }
 
   public Set keySet() {
@@ -150,4 +150,17 @@ public class EntityAdapter implements Map {
     }
   }
 
+  public Object getToOneRelation(String aWhereClause, String anOrderByClause, String aDefinition) {
+    try {
+      Iterator i = new EntityIteratorAdapter(aWhereClause, anOrderByClause, -1, getModel(), aDefinition);
+
+      if (i.hasNext())
+        return i.next();
+      else
+        return null;
+    }
+    catch (Throwable t) {
+      throw new RuntimeException(t.getMessage());
+    }
+  }
 }
\ No newline at end of file