protected LiteralRestrictionDescr buildLiteralRestrictionDescr(RuleBuildContext context,
RelationalExprDescr exprDescr,
String rightValue,
String operator,
boolean isRightLiteral) {
if ( isRightLiteral ) {
return new LiteralRestrictionDescr(operator, exprDescr.isNegated(), exprDescr.getParameters(), rightValue, LiteralRestrictionDescr.TYPE_STRING);
}
int dotPos = rightValue.lastIndexOf( '.' );
if ( dotPos >= 0 ) {
final String mainPart = rightValue.substring( 0,
dotPos );
String lastPart = rightValue.substring( dotPos + 1 );
try {
context.getDialect().getTypeResolver().resolveType( mainPart );
if ( lastPart.indexOf( '(' ) < 0 && lastPart.indexOf( '.' ) < 0 && lastPart.indexOf( '[' ) < 0 ) {
return new LiteralRestrictionDescr(operator, exprDescr.isNegated(), exprDescr.getParameters(), rightValue, LiteralRestrictionDescr.TYPE_STRING );
}
} catch ( ClassNotFoundException e ) {
}
}
return null;
}