About CompareValidator

The ComparisonValidator performs a logical comparison between an attribute value and another value. The supported operators are:

The other value can be either a literal value, the results of a SQL query, or the results of a view object query:

Type

Description

Literal value 

The list is created by providing one or more literal values to compare. 

Query result 

The list is created by executing a SQL query using a custom view object. The values are defined by the first column returned by the query. In both ListValidator and CompareValidator, attributes from the entity object being validated can be used as bind variables, for example, "SELECT UNIQUE loc FROM dept WHERE loc = %Loc%", where Loc is an attribute on the entity object being validated and thus has a method getLoc defined on it. 

View object attribute

The list is created by executing the query for a predefined view object. Choose the view object from the tree structure.