0 Replies Latest reply on Sep 18, 2008 1:45 PM by steffi.stephanie.stroka.salzburgresearch.at

    Mapping objects that are not entity-beans

    steffi.stephanie.stroka.salzburgresearch.at

      Hello!


      I'm working on a metadata-revision system and I'm searching for a very generic way how to store modified entity-beans in a db table.


      In general my MetadataUpdate entity-bean looks like that:



      @Entity
      public class MetadataUpdate implements Serializable {
          private Object entity;
          private Field field;
          private Object prevDBentry;
          private Object newDBentry;
      
          ....
      }



      Where all Objects are of different kind (e.g. User, TextContent, Address). Is there a way to map 'Object'? Can I annotate it somehow to make it possible to backtrack the object anyhow?


      I thought about replacing Object entity with an unique identifier and a String 'classname'. This would work with the Field, too, but prevDBentry and newDBentry will be a problem, since they can be Strings, Integers (, etc...) or entity-beans.