0 Replies Latest reply on Mar 8, 2006 6:06 AM by ant

    Accessing user-type-mapped fields in finder-methods

    ant

      Hi,

      is it possible to access a field of an EntityBean that is mapped to an user defined type (according to the instructions in the Wiki http://wiki.jboss.org/wiki/Wiki.jsp?page=UserTypeMapping) in finder methods?

      For example:

      @ejb.finder
       signature="java.util.Collection findByColor(ColorEnum color)"
       query="SELECT OBJECT(c) FROM Car AS c WHERE c.color = ?1"
      


      Searching the forum for this problem I found two issues addressing the problem,
      1. http://jira.jboss.com/jira/browseJBAS-2507 - support for <, <=, > and >= comparisons for types mapped with user-type-mapping

      and

      2. http://jira.jboss.com/jira/browseJBAS-1893 - Finders that use user-type-mappings are broken.

      The description of the first issue says:
      Types mapped with user-type-mapping are mapped to a single column, so, it makes sense to also support comparisons other than = and <>.

      Because of the bold text I assume that the current JBoss releases support "=" and "<>" comparisons in finder methods.

      Unfortunately I was not able to figure out how it can be achieved.

      Can anybody point me to the right direction?