|
ValidationExtension
JSR303 Validation Extension
Extension IntroductionThis is a simple extension to Morphia to process JSR303 Validation Annotations. UsingAdd this at the start of your application (or wherever you create your morphia instances). new ValidationExtension(morphia); ExampleHere is a simple example using (as an example) Hibernate validation: ...
import org.hibernate.validator.constraints.Email;
...
@Entity
public class Userlike {
@Id ObjectId id;
@Email String email;
}
ImplementationThis is a lightweight wrapper around the JSR303 API. It installs a simple global entity interceptor which listens to all life-cycle methods needed for validation. You can use any implementation of JSR303 by just adding it to the classpath. You can look at the code here. DependenciesManual
Maven
<dependency> <groupId>com.google.code.morphia</groupId> <artifactId>validation</artifactId> <version>0.99</version> </dependency> | |
► Sign in to add a comment
The Version that is on the maven and in the downloads is not valid, please check
The correct dependency is
<dependency> <groupId>com.google.code.morphia</groupId> <artifactId>morphia-validation</artifactId> <version>0.99</version> </dependency>it seems the maven repository is not having the latest code , cause i cannot find the ValidationExtension class
Same thing here, where is the ValidationExtension class?
Can you release maven artifact for latest revision?