[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2689) HQL Query using the relationary operator "or"

Luiz Alberto (JIRA) noreply at atlassian.com
Wed Jun 27 10:18:52 EDT 2007


HQL Query using the relationary operator "or"
---------------------------------------------

                 Key: HHH-2689
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2689
             Project: Hibernate3
          Issue Type: Bug
          Components: query-hql
    Affects Versions: 3.2.0.cr4
         Environment: ORACLE 9I
HIBERNATE 3.2
            Reporter: Luiz Alberto
            Priority: Critical




*************
EXAMPLE TABLE "REQUERIMENTO" IN THE DATA BASE 

ROWID  |   ID(PK)      |   LABO(FK)    |   GRADUACAO(FK)
--------------------------------------------------------- 
1      |      110      |  5302332      |       NULL
2      |      120      |    NULL       |     4002993
3      |      130      |    NULL       |     5321663
4      |      140      |  3698566      |       NULL
5      |      150      |  5699636      |       NULL


*************
Mapping 

RequerimentoVO
 .getMatriculaGraduacao() --> GraduacaoVO
 .getMatriculaLABO() --> LaboVO

**************

I use one query "HQL". Predicate "OR" is used of the following form.

 " FROM RequerimentoVO r "
 " where ( r.matriculaGraduacao.id = :codigo or r.matriculaLABO.matricula = :codigo ) "

  Which is the problem? It is bug of the Hibernate? Query returns "null"

  which and the problem? I am thankful


***************                  
Exception when:

" FROM RequerimentoVO r "
" where r.matriculaGraduacao.id = :codigo " 
	
it returns a RequerimentoVO  
	
or in such a way 

" FROM RequerimentoVO r "
" where r.matriculaLABO.matricula = :codigo = :codigo "

it returns a RequerimentoVO

which and the problem? I am thankful

I am thankful !

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list