Why does JPA require a no-arg constructor for domain objects?

Because it often happens that the JPA provider has to instantiate your domain object dynamically. It cannot do so, unless there is a no-arg constructor - it can't guess what the arguments should be.

Does that also mean that the no-arg constructor might get called after persisting an entity (e.g. When the entity manager initially loads an entity). In this case, we should not initialize any fields or do some other work in the constructor, right? – Theo Apr 28 at 13:49 @Theo - yes, the constructor is called when you load an entity.

– Bozho Apr 28 at 13:55.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions