From the forum: https://forum.hibernate.org/viewtopic.php?f=26&t=1040725
For multi-layered applications it'd be very beneficial to be able to copy constraint declarations from the types in one model to the correponding types in other model(s). E.g. something along the following lines:
{code} ConstraintCopier cc = ...; cc.copyConstraints() .from(CustomerEntity.class) .to(CustomerView.class) .from(OrderEntity.class) .to(OrderView.class) .property( "itemCode" ) .ignore() .property( "size" ) .mapTo( "orderedSize" ) .ignoreConstraints( Length.class ); {code}
|