<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -21,17 +21,18 @@
     &lt;/build&gt;
   &lt;dependencies&gt;
     &lt;dependency&gt;
-      &lt;groupId&gt;junit&lt;/groupId&gt;
-      &lt;artifactId&gt;junit&lt;/artifactId&gt;
-      &lt;version&gt;3.8.1&lt;/version&gt;
-      &lt;scope&gt;test&lt;/scope&gt;
+      &lt;groupId&gt;mysql&lt;/groupId&gt;
+      &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
+      &lt;version&gt;5.1.6&lt;/version&gt;
+      &lt;scope&gt;compile&lt;/scope&gt;
     &lt;/dependency&gt;
     &lt;dependency&gt;
-            &lt;groupId&gt;mysql&lt;/groupId&gt;
-            &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
-            &lt;version&gt;5.1.6&lt;/version&gt;
+            &lt;groupId&gt;junit&lt;/groupId&gt;
+            &lt;artifactId&gt;junit&lt;/artifactId&gt;
+            &lt;version&gt;4.5&lt;/version&gt;
             &lt;scope&gt;compile&lt;/scope&gt;
         &lt;/dependency&gt;
     
+    
   &lt;/dependencies&gt;
 &lt;/project&gt;</diff>
      <filename>pom.xml</filename>
    </modified>
    <modified>
      <diff>@@ -30,11 +30,17 @@ public class App
         Post post = posts.get(0);
         post.setAttribute(&quot;title&quot;, &quot;Titulo Trocado&quot;);
         post.save();*/
+
         Properties prop = new Properties();
         prop.put(&quot;id&quot;, 24);
         List&lt;Post&gt; posts = JavaRecord.find(Post.class, prop);
         print(posts.size());
         Post post = posts.get(0);
+        Post p1 = post;
+        p1.setAttribute(&quot;id&quot;, null);
+        p1.setAttribute(&quot;title&quot;, &quot;Novo post&quot;);
+        p1.save();
+        
         print(post.getAttribute(&quot;id&quot;));
     }
     </diff>
      <filename>src/main/java/net/java/javarecord/App.java</filename>
    </modified>
    <modified>
      <diff>@@ -100,6 +100,18 @@ public abstract class JavaRecord {
         this.attributes = attributes;
     }
 
+    public void delete(){
+        resolver.delete();
+    }
+
+    /**
+     * Generic method do make a find in the dabase. the return away is a List
+     * @param &lt;T&gt; generic type
+     * @param objClazz Entity class to find
+     * @param params condititions to find, can be null
+     * @return List of find object
+     * @since 1.0
+     */
     public static &lt;T&gt; T find(Class&lt;? extends JavaRecord&gt; objClazz, Properties params) {
         try {
             Object instance = objClazz.newInstance();
@@ -120,7 +132,7 @@ public abstract class JavaRecord {
         }
     }
 
-    public TableResolver getResolver() {
+    private TableResolver getResolver() {
         return resolver;
     }
 }</diff>
      <filename>src/main/java/net/java/javarecord/JavaRecord.java</filename>
    </modified>
    <modified>
      <diff>@@ -32,13 +32,21 @@ public class SQLGenerator implements Generator {
     private ResultSetMetaData metaData;
     private Map&lt;String, Object&gt; attributes;
     private String primaryKey;
-
+    /**
+     * Defaults construtor
+     * @param adapter Adapter to use
+     * @param tableName
+     * @since 1.0
+     */
     public SQLGenerator(Adapter adapter, String tableName) {
         this.adapter = adapter;
         this.tableName = adapter.isUpperCase() ? tableName.toUpperCase() : tableName;
         primaryKey = getPrimaryKeyColumn();
     }
-
+    /**
+     * Retrive the default column and make the attributes to the database
+     * @since 1.0
+     */
     @Override
     public void loadAttributes() {
         StringBuilder sb = new StringBuilder(&quot;SELECT * FROM &quot;).append(tableName);
@@ -68,7 +76,11 @@ public class SQLGenerator implements Generator {
             }
         }
     }
-
+    /**
+     * Getts the attributes of the loaded table
+     * @return Map&lt;String, Object&gt;
+     * @since 1.0
+     */
     @Override
     public Map&lt;String, Object&gt; getAttributes() {
         if (attributes != null) {
@@ -117,7 +129,12 @@ public class SQLGenerator implements Generator {
             throw new SQLGeneratorException(ex.getMessage(), ex);
         }
     }
-
+    /**
+     * Generic method to call. Insert a registry if the PrimaryKey column is empty
+     * @since 1.0
+     * @see #insert()
+     * @see #update()
+     */
     @Override
     public void save() {
         if (attributes.get(primaryKey) == null) {
@@ -127,7 +144,10 @@ public class SQLGenerator implements Generator {
         }
 
     }
-
+    /**
+     * Update a registry in the database
+     * @since 1.0
+     */
     @Override
     public void update() {
         if (attributes.get(primaryKey) == null) {
@@ -165,7 +185,10 @@ public class SQLGenerator implements Generator {
             throw new SQLGeneratorException(ex.getMessage(), ex);
         }
     }
-
+    /**
+     * Insets a registry (new registry) in the database
+     * @since 1.0
+     */
     @Override
     public void insert() {
         StringBuilder sb = new StringBuilder(&quot;INSERT INTO &quot;);
@@ -212,7 +235,10 @@ public class SQLGenerator implements Generator {
             throw new SQLGeneratorException(ex.getMessage(), ex);
         }
     }
-
+    /**
+     * Removes an registry from the database
+     * @since 1.0
+     */
     @Override
     public void remove() {
         if (attributes.get(primaryKey) == null) {
@@ -231,7 +257,11 @@ public class SQLGenerator implements Generator {
         }
 
     }
-
+    /**
+     * Sets the atributes
+     * @param attributes to set
+     * @since 1.0
+     */
     @Override
     public void setAttributes(Map&lt;String, Object&gt; attributes) {
         if (attributes == null) {
@@ -239,7 +269,15 @@ public class SQLGenerator implements Generator {
         }
         this.attributes = attributes;
     }
-
+    /**
+     * Overrides the generator find, and call the correct method to use find
+     * @param entityClass Class of the entity to load
+     * @param conditions Properties file to make the conditions, can be null
+     * @return List
+     * @since 1.0
+     * @see #findAll(java.lang.Class)
+     * @see #findByConditions(java.lang.Class, java.util.Properties) 
+     */
     @Override
     public List&lt;? extends JavaRecord&gt; find(Class&lt;? extends JavaRecord&gt; entityClass, Properties conditions) {
         if (conditions == null) {
@@ -249,8 +287,12 @@ public class SQLGenerator implements Generator {
     }
 
     /**
-     * FindAll
-     * @return
+     * Load all objects of this entity class
+     * @param entityClass Class of the entity to load all
+     * @return List
+     * @since 1.0
+     * @see #find(java.lang.Class, java.util.Properties)
+     * @see #findByConditions(java.lang.Class, java.util.Properties)
      */
     private List&lt;? extends JavaRecord&gt; findAll(Class&lt;? extends JavaRecord&gt; entityClass) {
         PreparedStatement smt = database.getPreparedStatement(&quot;SELECT * FROM &quot; + tableName);
@@ -278,7 +320,15 @@ public class SQLGenerator implements Generator {
             throw new SQLGeneratorException(&quot;findAll throw Exception: &quot; + ex.getMessage(), ex);
         }
     }
-
+    /**
+     * Generates an Select clause using the WHERE statement
+     * @param entityClass Class of the entity to load
+     * @param conditions Properties file to make the conditions, can be null
+     * @return List
+     * @since 1.0
+     * @see #find(java.lang.Class, java.util.Properties)
+     * @see #findAll(java.lang.Class) 
+     */
     private List&lt;? extends JavaRecord&gt; findByConditions(Class&lt;? extends JavaRecord&gt; entityClass, Properties conditions) {
         StringBuilder sb = new StringBuilder(&quot;SELECT * FROM &quot;);
         sb.append(tableName).append(&quot; WHERE &quot;);</diff>
      <filename>src/main/java/net/java/javarecord/adapter/jdbc/SQLGenerator.java</filename>
    </modified>
    <modified>
      <diff>@@ -108,6 +108,10 @@ public class TableResolver {
     //saveHasMany();
     }
 
+    public void delete(){
+        generator.remove();
+    }
+
     /**
      * Search for each hasMany key, and save each JavaRecord object of the list
      * @since 1.0</diff>
      <filename>src/main/java/net/java/javarecord/adapter/jdbc/TableResolver.java</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>ab9399e4418563807ab6d15f38240b9e9f656a39</id>
    </parent>
  </parents>
  <author>
    <name>Rafael Felix</name>
    <email>felix.rafael@gmail.com</email>
  </author>
  <url>http://github.com/fellix/javarecord/commit/c74b25b855e7e0d6da7931ca0d7c45f6ab118d2f</url>
  <id>c74b25b855e7e0d6da7931ca0d7c45f6ab118d2f</id>
  <committed-date>2009-04-30T18:05:50-07:00</committed-date>
  <authored-date>2009-04-30T18:05:50-07:00</authored-date>
  <message>Added JUnit 4.5 library and some JavaDoc added</message>
  <tree>8fdc48e75c26811262dd9229b564c64709f36b4a</tree>
  <committer>
    <name>Rafael Felix</name>
    <email>felix.rafael@gmail.com</email>
  </committer>
</commit>
