[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4917) Keyword TYPE not supported

Juergen Zimmermann (JIRA) noreply at atlassian.com
Sat Feb 13 02:42:30 EST 2010


Keyword TYPE not supported
--------------------------

                 Key: HHH-4917
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4917
             Project: Hibernate Core
          Issue Type: Bug
          Components: entity-manager
    Affects Versions: 3.5.0-CR-1
            Reporter: Juergen Zimmermann


The keyword TYPE according to JPA 2 cannot be used:

In PostgreSQL:
CREATE TABLE kunde(
	k_id BIGSERIAL NOT NULL PRIMARY KEY,
	...
	art CHAR(1) DEFAULT 'P'
);

Entity classes:
@Entity
@Table(name="kunde")
@Inheritance
@DiscriminatorColumn(name="art", length=1)
@NamedQueries({
@NamedQuery(name = "typeSample",
query = "SELECT k FROM  Kunde k WHERE TYPE(k) IN (Privatkunde, Firmenkunde)")
})
public abstract class Kunde implements java.io.Serializable {...}

@Entity
@DiscriminatorValue("P")
public class Privatkunde extends Kunde {...}
public abstract class Kunde implements java.io.Serializable {...}

Wrong generated SQL query:
select
    ... 
from
    kunde kunde0_ 
where
    TYPE(kunde0_.k_id) in (
        'P' , 'F'
    )



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