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

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


    [ http://opensource.atlassian.com/projects/hibernate/browse/EJB-345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_29857 ] 

Reid Hartenbower commented on EJB-345:
--------------------------------------

Sorry, for the second query I meant
  "select distinct object(i) from Item i, Specification s where i.container is null and i.specification = s and :key not in indices(s.properties)"
which parses but gives same 'operand should contain  1 column(s)' error

> 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