From fb7a2e2a24eae2f86c93fd9508638c84e5c8b275 Mon Sep 17 00:00:00 2001 From: Rzepa Date: Mon, 21 Jul 2014 23:23:06 +0200 Subject: [PATCH] validation auxiliary methods --- docs/validation.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/validation.md b/docs/validation.md index b2f06525..a5631937 100644 --- a/docs/validation.md +++ b/docs/validation.md @@ -77,8 +77,27 @@ def invariantNameMustNotBeEmpty = ``` If a pre-condition is violated, Activate throws an InvariantViolationException. +### AUXILIARY METHODS + +- **email** pattern + +`protected def email(string: => String)` + +- **not empty** + +`protected def notEmpty[T](iterable: => Iterable[T])` + +- **not null** + +`protected def notNull(obj: => Any)` + +- **unique** + +`protected def unique(criterias: (this.type => Any)*)(implicit m: Manifest[this.type])` + ## INVARIANTS LIFECYCLE ## + It’s possible to define validation options globally, by transaction, by thread or by entity instance. The available options are: - **onCreate**