3 Replies Latest reply on Feb 2, 2007 7:16 AM by Andreas Franke

    <ENTITY> not mapped

    Andreas Franke Apprentice


      I using a InheritanceType.SINGLE_TABLE and try to query this, but without success.

      Here my abstract superclass

      @Inheritance(strategy = InheritanceType.SINGLE_TABLE)
      @DiscriminatorColumn(name = "PERSON_TYPE", discriminatorType = DiscriminatorType.STRING)
      public abstract class Person extends BaseEntity{
       @Id @GeneratedValue
       @Column(name = "PERSON_ID")
       private Long id;

      and the extended subclass
      public class User extends Person
      ..... {

      Now when I use to query ("from person where PERSON_TYPE='US' order by name, forename") the user class the following exception is thrown
      Caused by: org.hibernate.hql.ast.QuerySyntaxException: person is not mapped [from person where PERSON_TYPE='US' order by name, forename]

      All tables are created when the app is deployed.

      Using JBoss-4.0.5.GA with Seam 1.1.1

      Any idea whats wrong in my app?