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

    <ENTITY> not mapped

    Andreas Franke Apprentice

      Hi,

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

      Here my abstract superclass

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


      and the extended subclass
      @Entity
      @DiscriminatorValue("US")
      @Name("user")
      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?


      Thanks
      Andreas