title: Java annotation fields setter and getter how to
body: <p>What I want to accomplish but don't understand really how it works its</p>
  
  <pre><code>@Table(name = "Categories")
  public class Category extends Model { 
      @Column(name = "Name")
      private String name;
  }
  </code></pre>
  
  <p>With this code I want to annotation generate their respective setter and getter so I can use like</p>
  
  <pre><code>Category category = new Category();
  category.setName("My Name");
  category.save();
  </code></pre>
  
  <p>Whey I need setter and getter and not access/edit the value directly? Because some values has different treatment, like relations, and because I want to have fields that don't want to be edited. And I'm too lazy to do manually all the time this, with every model, also save a lot of work later to just put an annotation and set their field</p>
  
  <p>My inspiration to try this was <a href="https://github.com/excilys/androidannotations" rel="nofollow">Android Annotations</a> seems a solid and cool library, I know maybe its too advanced but my goal with this experiment its to have a library like that but focused on models like active record or another orm.</p>
  
  <p>Tuts, tips, advices, books are welcome.</p>
  
  <p>Regards</p>
  
  <p><strong>Edit 2013-10-25</strong></p>
  
  <p>My goal is to build a library capable to do this, because I'm too curious and want to learn how internally work, so I'll be able to power my framework with this feature, as jet just are small utilities but in the future I hope it save me a lot of work, you can see at github <a href="https://github.com/norman784/wsd-android" rel="nofollow">WSD Android</a></p>