Validation App Block validating NetTiers entities - validation

Here is my question: does anyone know how to set up custom validation for NetTiers entities?
I have a NetTiers web solution that was generated with the EntLib 4.1 validation app block. The actual entities' properties are decorated with the validation attributes to ensure that the dataase integrity is maintained. What I need to do is add custom validation to the entities.
I know how to write the custom validators. I'm just not sure how to wire them up to the each entities so that I can perform custom validation. What I am looking for is an overview on how to do this.
Any help would be appreciated.
Thanks,
Joe

Are you using the latest release of .netTiers? Support for data annotations was added in this patch and committed to core.
I would take a look at the following documentation. I'm thinking that this is something that you would need to wire up programmatically. Well make sure that this scenario works in v3.

Related

JSR 303 vs Spring validation

I am new to Spring validation. Recently I have been exploring different approaches of validation utilities available in Spring. I found there are basically two approaches: 1. with JSR-303 and 2. by implementing Validator interface in Spring.
What I understood, with first approach one can achieve model level validation whereas the latter is more appropriate to validate String, Integer types of inputs. Is there something more, that I am missing here?
Here is an open source alternative to JSR-303.
This solution can perform all validation of the request message, but no hassle coding is required.
https://github.com/ckpoint/CheckPoint
With Check-Point, all validation is possible without further code, just by changing the annotation of the Controller method.
After that, all validation settings can be easily made in Admin Page.
I think this video can help your understand. https://youtu.be/I1aEIztXlhE
Check-Point Admin-Page Setting Screen

Spring client validation on a non DB field

I have a spring flow project. On the form I want to add a check box, like "I confirm that I have provided correct details" and want to stop the flow if this check box is not checked. I don't want to add this as a DB field (validation through that is pretty simple). I cant find a way to validate the check box at client side. Any examples/options are appreciated.
jsr-303 or jsr-349 are the standards for bean validation, and is the reference yoou're looking for, from a high point of view. Youcan start reading from Wikipedia: https://en.wikipedia.org/wiki/Bean_Validation
When it comes to implement this in Spring, you have to annotate the parameter passed to the MVC handler method as #Valid and implement a Validator. The best example you could look at, initially, is the Spring official documentation:http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html

How to create a specific validator for a field's model

I want to use a specific validation for a field in my class. It should assure that the username field follow some specific rules.
Can someone point me some docs that show me how to create a validator specifically for a field in a class?
I'm using Spring framework.
Whats wrong with the spring documentation.
The page for that is usually http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html
There are different ways to do that. I personally prefer the javax.validation spring integration instead of the system by spring directly. The creation of a custom validator for an object can be seen in the hibernate-validator (implementation of javax.validation) https://docs.jboss.org/hibernate/validator/4.0.1/reference/en/html/validator-customconstraints.html

How can I replace Hibernate Validator with something else?

I'm not the fan of Hibernate Validator. I would like to use something else (like oval) or implement my custom validation logic. What's the best way to replace Hibernate Validator with my custom validation logic?
As Hibernate Validator (>= 4.x) is one implementation of the Bean Validation specification (javax.validation.* API) you can use other compliant implementations easily (of course depending on to which degree you're using HV specific APIs and functionality such as the provided custom constraints).
Bean Validation provides the concept of custom constraints to implement custom validation logic.
That said (I'm one of the HV committers), what is it that makes you wish to use another implementation? If you found any bugs or have feature requests, you can open a ticket in our issue tracker. If you have an idea for improvement you'd like to discuss, you can either post to our forum or the mailing list. Any feedback matters, so be sure to speak up.

where is #Equals annotation in playframework 2.0?

I am trying to validate the equality of password with confirmPassword field in a registration form.
I am aware that in v.1(precisely v.1.2.4), you can do this using #Equals("confirmPassword") annotation.
However the same functionality seems to be missing in v2.0.
Am I missing out on something or v2.0 doesn't implement this anymore?
Have a look at Forms Validation for Play 2.0, specifically the Constraints section. The play.data.validation.Constraints class contains several built-in validation annotations according to the documentation. They made a lot of changes between the 1.* and 2.* versions.

Resources