[hibernate-issues] [Hibernate-JIRA] Created: (EJB-345) compound primary/foreign key problems with nulls and NamedQuery parsing

Reid Hartenbower (JIRA) noreply at atlassian.com
Mon Mar 24 14:20:33 EDT 2008


compound primary/foreign key problems with nulls and NamedQuery parsing
-----------------------------------------------------------------------

                 Key: EJB-345
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/EJB-345
             Project: Hibernate Entity Manager
          Issue Type: Bug
          Components: EntityManager
    Affects Versions: 3.3.2.GA
         Environment: Hibernate core 3.2.6.ga, Hibernate EntityManager 3.3.2.GA, Hibernate Validator 3.0.0.GA, Hibernate Annotations 3.3.1.GA
MySQL 5.0.45 / driver jar mysql-connector-java-3.1.12-bin
            Reporter: Reid Hartenbower
         Attachments: test-src.zip

Hi.  I have Item, Container, and Specification entities that subclass NamedThing.  NamedThing uses a compound primary key which is a two-long representation of a UUID.  Item has a @ManyToOne with Container and Specification, and Specification has a <String,String> properties map.

Two problems, first:

  queries like "select distinct object(i) from Item i where i.specification.properties[:key] = :value"  produce parse errors (these are the commented-out NamedQueries in Item); the complaint is '.' character after specification

  queries like "select distinct object(i) from Item i, Specification s where i.container is null and i.specification = s and s.properties[:key] is null" in TestItem.java:61 do parse successfully but produce the exception whose stack trace is in TestItemStackTrace.txt.  The hibernate sql is in hibernate-sql-output.txt; the complaint is 'java.sql.SQLException: Operand should contain 1 column(s)'

Thanks,
Reid


-- 
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