by Rob 20 Feb 22:30
coming soon.... Validation.... @NotNull @Length(max=25) ...

I am putting this into the next release. There is already work in this area (Hibernate, JSR etc)... so we will need to watch these to see the developments.

Its ended up to be a similar design to Hibernate Validation. That is, you annotate your properties with @NotNull, @Length(min=5,max=20) etc - these annotations I would expect to become standardised by the JSR in the future.

I am pretty conscience of the potential performance penalty and cascading validation (cascading like save and delete can). I have ended up putting the validation inside Ebean itself rather than an external framework (bypassing reflection and building fast meta data about what validation needs to occur when).

All in all pretty good stuff...

20 Feb 22:34
by Rob

This will be most beneficial to those using jdbc batching... as it is not asways obvious which data is at fault.

Ebean will run the validation tests on save and delete throwing an exception if required. Ebean will also expose validate() methods so that you can validate a bean or individual property explicitly.

I am also thinking a global property to turn on/off validation would be useful.

Create a New Topic

Title:
Body:
 
Introduction User Guide (pdf) Install/Configure Public JavaDoc Whitepapers
General Database Specific Byte Code Deployment Annotations Features
Top Bugs Top Enhancements
woResponse