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....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira