0 Replies Latest reply on Oct 3, 2002 7:14 PM by Eric Gascoine

    EJB-QL and String Comparison Operators

    Eric Gascoine Newbie

      Hi, I'm trying to do some work in the CMP/JBoss and need to compare a field to be within a certain range.

      I've discovered that the CMP limits string comparisons to = and <> . This is direct contrast to the J2EE specs from SUN which read as follows:

      comparison_expression :: =
      string_value comparison_operator string_expression |
      boolean_value {=|<>} boolean_expression |
      datetime_value comparison_operator datetime_expresssion
      ...

      comparison_operator :: =
      = | > | >= | < | <= | <>

      I've examined the file EJBQLParser.jjt and found that this seems to be intentional. I've made the modifications to allow the full range of comparison_operators for strings and tested it against a very simple dataset using the default datasource, and it works.....

      My question is Why don't we conform to the spec? and if it's an issue of not knowing how a database is going to answer the >,<,<=,>= comparitors, why don't we make that a deployment issue rather than handicapping ourselves at the initial development stage?

      -Eric