Hack of the day:
Most O/R mapper frameworks require entities to implement a default constructor.
This is most often not a big deal, most entities would support a default constructor no matter if the mapper needed it or not.
However, if you intend to expose an entity that only support a copy constructor.
Let’s say for the sake of the argument that we have an immutable “Order” class, that can only be created by passing an “OrderRequest”:
public class Order { public Order( OrderRequest request ) ...
No comments yet, be the first one to post comment.