Set the persistence property datanucleus.validation.mode to one
of auto, none (default), or callback

Optionally set the persistence property(s)
datanucleus.validation.group.pre-persist,
datanucleus.validation.group.pre-update,
datanucleus.validation.group.pre-remove to fine tune the behaviour (the default is
to run validation on pre-persist and pre-update if you don't specify these).

Use JDO as you normally would for persisting objects

To give a simple example of what you can do with the Bean Validation API

So we are validating that instances of the Person class will have an "id" that is not null
and that the "name" field is not null and between 3 and 80 characters. If it doesn't validate then
at persist/update an exception will be thrown.

A further use of the Bean Validation annotations @Size(max=...) and @NotNull is that if you specify these
then you have no need to specify the equivalent JDO "length" and "allowsNull" attributes since they equate to
the same thing.