I want to know that if I have this in my constructor:
public class Foo {
private final String param1;
private final String param2;
foo() { this.param1 = "param1"; }
}
Now i want to know that if i retrieve object from database then does same constructor gets called or it only happens at first time only
Yes, Hibernate invokes the no-arg constructor for every entity instance it creates and populates. Your above code is not Java code, though.