Translated the JavaDocs to English, added some comments.
authormj <mj>
Mon, 25 Feb 2002 20:58:56 +0000 (20:58 +0000)
committermj <mj>
Mon, 25 Feb 2002 20:58:56 +0000 (20:58 +0000)
source/mir/entity/Entity.java

index 0d2f4ce..6dd39ac 100755 (executable)
@@ -1,6 +1,6 @@
 /**
  * Base class the entities are derived from. Provides base functionality of
- * an entity<p>
+ * an entity. Entities are used to represent rows of a database table.<p>
  */
 
 
@@ -46,7 +46,8 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
     }
 
   /**
-   * Konstruktor
+   * Constructor
+   * @param StorageObject The StorageObject of the Entity.
    */
   public Entity (StorageObject StorageObject) {
     this();
@@ -54,15 +55,15 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
   }
 
   /*
-   * Setzt das StorageObject der Entity.
+   * Sets the StorageObject of the Entity.
    */
   public void setStorage (StorageObject storage) {
     this.theStorageObject = storage;
   }
 
   /**
-   * Setzt die Werte der Entity
-   * @param theStringValues
+   * Sets the values of the Entity.
+   * @param theStringValues HashMap containing the new values of the Entity
    */
 
   public void setValues(HashMap theStringValues)
@@ -83,7 +84,7 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
  }
 
   /**
-   * Liefert boolschen Wert, ob sich der Inhalt der Entity geändert hat.
+   * Returns whether the content of the Entity has changed.
    * @return true wenn ja, sonst false
    */
   public boolean changed () {
@@ -91,7 +92,7 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
   }
 
   /**
-   * Liefert den Primärschluessel der Entity zurueck
+   * Returns the primary key of the Entity.
    * @return String Id
    */
   public String getId () {
@@ -99,7 +100,7 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
   }
 
   /**
-   * Setzt den Primaerschluessel der Entity
+   * Defines the primary key of the Entity
    * @param id
    */
   public void setId (String id) {
@@ -107,9 +108,9 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
       }
 
   /**
-   * Liefert den Wert für einen Feldnamen zurueck
-   * @param theFieldString
-   * @return Wert für Feld
+   * Returns the value of a field by field name.
+   * @param field The name of the field
+   * @return value of the field
    */
   public String getValue (String field) {
     String returnValue = null;
@@ -140,8 +141,8 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
   }
 
   /**
-   * Fügt Entity via StorageObject in Datenbank ein.
-   * @return Primary Key der Entity
+   * Insers Entity into the database via StorageObject
+   * @return Primary Key of the Entity
    * @exception StorageObjectException
    */
   public String insert () throws StorageObjectException {
@@ -154,7 +155,7 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
   }
 
   /**
-   * Aktualisiert Aenderungen an der Entity in der Datenbank
+   * Saves changes of this Entity to the database
    * @exception StorageObjectException
    */
   public void update () throws StorageObjectException {
@@ -162,9 +163,9 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
   }
 
   /**
-   * Setzt den Wert fuer ein Feld
-   * @param theProp
-   * @param theValue
+   * Sets the value for a field. Issues a log message if the field name supplied was not found in the Entity.
+   * @param theProp The field name whose value has to be set
+   * @param theValue The new value of the field
    * @exception StorageObjectException
    */
   public void setValueForProperty (String theProp, String theValue) throws StorageObjectException {
@@ -178,18 +179,17 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
   }
 
   /**
-   * Gibt die Feldnamen der Entity als ArrayList zurueck
-   * @return ArrayList mit Feldnamen
-   * @exception StorageObjectException wird geworfen, wenn kein Zugriff auf die Datenbank
-   *    möglich.
+   * Returns the field names of the Entity as ArrayListe.
+   * @return ArrayList with field names
+   * @exception StorageObjectException is throuwn if database access was impossible
    */
   public ArrayList getFields () throws StorageObjectException {
     return  theStorageObject.getFields();
     }
 
   /**
-   * Liefert ein int[] mit den Typen der Felder zurueck
-   * @return int[] mit den Feldtypen
+   * Returns an int[] with the types of the fields
+   * @return int[] that contains the types of the fields
    * @exception StorageObjectException
    */
   public int[] getTypes () throws StorageObjectException {
@@ -197,8 +197,8 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
     }
 
   /**
-   * Liefert ArrayListe mit Feldnamen zurueck.
-   * @return Liste mit Feldnamen
+   * Returns an ArrayList with field names
+   * @return List with field names
    * @exception StorageObjectException
    */
   public ArrayList getLabels () throws StorageObjectException {
@@ -206,8 +206,8 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
     }
 
   /**
-   * Liefert eine Hashmap mit allen Werten der Entity zurueck
-   * @return HashMap mit Feldname/Wert
+   * Returns a Hashmap with all values of the Entity.
+   * @return HashMap with field name as key and the corresponding values
    *
    * @deprecated This method is deprecated and will be deleted in the next release.
    *  Entity interfaces freemarker.template.TemplateHashModel now and can
@@ -220,6 +220,11 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
     }
 
     /**
+     * Returns an ArrayList with all database fields that can
+     * be evaluated as streamedInput.
+     * Could be automated by the types (blob, etc.)
+     * Until now to be created manually in the inheriting class
+     *
      *  Liefert einen ArrayList mit allen Datenbankfeldern, die
      *  als streamedInput ausgelesen werden muessen.
      *  Waere automatisierbar ueber die types (blob, etc.)
@@ -230,17 +235,17 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
     return streamedInput;
   }
 
-   /* Fragt ab, ob fieldName einem Feld entspricht
+   /** Returns whether fieldName is a valid field name of this Entity.
    * @param fieldName
-   * @return true, wennn ja, sonst false
+   * @return true in case fieldName is a field name, else false.
    * @exception StorageObjectException
    */
   public boolean isField (String fieldName) throws StorageObjectException {
     return  theStorageObject.getFields().contains(fieldName);
   }
 
-   /** Liefert Anzahl der Instanzen zurück
-   * @return int
+   /** Returns the number of instances of this Entity
+   * @return int The number of instances
    */
   public int getInstances() {
      return instances;
@@ -252,7 +257,7 @@ public class Entity implements TemplateHashModel, TemplateModelRoot
   }
 
   /**
-   * Gibt eine Instanz frei
+   * Frees an instance
    */
   /*public void finalize () {
     instances--;