2 Replies Latest reply on Oct 5, 2006 2:48 PM by Michael Andrewes

    EntityManager, annotation question

    Michael Andrewes Newbie


      I have not been able to find any documentation on this, at least so far, I'm thinking that the solution is probably an annotation (which are new to me).

      I have a couple of objects that are extended from a base object, I store them all in one table "assets". It's only the classes logic methods that differ, all persisted fields are in the base object.
      I am not using the MappedSuperclass annotation because, from what i read the behaviour is not what I want, and it doesnt look like it will help me.

      I can persist the objects fine, and use the find() method; my problem occurs when I try to use the createQuery() method of entitimanager to read data out of the table "assets", the name "assets" has no class named the same, so I get an exception "assets is not mapped [from assets a]".

      How do I tell the Entity manager to map this class to a given class or interface without using a native query? (which I have not yet tried).