Do I have to have the word get and set in my Java class using Hibernate? -


most examples i've seen this,

private int productid; private string proname; private double price;  public void **set**productid(int productid) {     this.productid = productid; } public int **get**productid() {     return productid; }  public void setproname(string proname) {     this.proname = proname; } public string getproname() {     return proname; }  public void setprice(double price) {     this.price = price; } public double getprice() {     return price; } 

is naming convention required when using hibernate?

this name convention introduced java beans. uniform naming convention of properties (getxxx , setxxx) allowed runtime discovery (and access) of properties of java beans frameworks. since hibernate can access private fields using reflection, explained in how can hibernate access private field?, not neccessary follow naming convention, practice.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -