talktopraveenkumar wrote:
Hi,
I have come up with a situation where I have a class which does not contain any blank constructor and setter getter methods. Becuase it does not make sense to create an object of that class with blank constructor. It is a business specific requirement.
Now I have to persist that class in a table. Is there a way we can do this? Because Hibernate 2 says that we should have a blank constructor with setter and getter methods.
I believe the reason is that it is constructed that way with reflection by hibernate. Check out where this occurs in Hibernate's code to see if there is a way around it... Do you create it with a factory, or a constructor with multiple arguments? I would just subclass it and give it a default constructor... anyone correct me if there is a way.
Chris