How can I apply a Play 2 uniqueness validation only when an object is being created? I can add a custom verifying clause, but it would fail when editing (as opposed to creating) an existing objet.
How can I apply a Play 2 uniqueness validation only when an object is
Share
If you are not performing the same validation checks on edition and creation maybe it means that you should not use the same
Formobject for both? Actually, there are only a few particular cases where it makes sense to use the sameFormobject for both creation and edition in real world programs.On the other hand, if you don’t want to duplicate some validation logic that is common to both creation and edition you can reuse a mapping fragment in your two
Formobjects: