1 Reply Latest reply on Jun 26, 2002 7:46 PM by dsundstrom

    JBoss-QL Request

    ryanramage

      I remember some time ago a message on the forums from Dain for requests to the JBoss-QL. I have a suggestion that I hope might be a idea for the future. Here it goes:

      I would like to be able to access the field as a java object from within in the query. For example, a bean that has an Collection object as a container managed field. A query like:
      SELECT(o) FROM MyBean o WHERE o.theCollection.contains(?1)

      I guess the only constraint would be the WHERE expression would have to evaluate to a boolean. The query:
      SELECT(o) FROM MyBean o WHERE o.theCollection.size()
      would make no sense. The expression would fail at runtime.


      There would be endless possibilities for this, you could call on the power of all the methods of an object. How does this sound? Can it be done?

        • 1. Re: JBoss-QL Request
          dsundstrom

          > I remember some time ago a message on the forums from
          > Dain for requests to the JBoss-QL. I have a
          > suggestion that I hope might be a idea for the
          > future. Here it goes:

          I am still looking for ideas, so thanks.

          > I would like to be able to access the field as a java
          > object from within in the query. For example, a bean
          > that has an Collection object as a container managed
          > field. A query like:
          > SELECT(o) FROM MyBean o WHERE
          > o.theCollection.contains(?1)
          >
          > I guess the only constraint would be the WHERE
          > expression would have to evaluate to a boolean. The
          > query:
          > SELECT(o) FROM MyBean o WHERE o.theCollection.size()
          >
          > would make no sense. The expression would fail at
          > runtime.

          This one is unlikely to happen because I need to be able to translate the query into SQL and there is no way to do this in SQL. It may be possible for a pure Java database, but I don't know of any that support that. It would also be very slow, because you would have to deserialize every object in every row and then execute a method call.

          It was a good idea anyway. I would like to be able to support arrays this way because a lot of databases do support SQL arrays.