0 Replies Latest reply on Jul 15, 2006 5:45 PM by flo thomas

    Ignoring empty contained entities

    flo thomas Newbie

      Hi,
      I have a question regarding the possibility to ignore entities dynamically, based on whether or not they contain data. Let me explain:

      class Person implements Serializable {
      private Information info = new Information();
      private String name;
      ...

      }

      now I don't want to save the information in case it remains empty, but at the same time I want to make use of the cascading functionality, but at times, Persons don't have information the information object would be empty. I cannot just leave it out, since I work with Seam and info.description for example might be injected, but if that field for example is null, I would like to ignore the info object so that I don't have any null-containing rows in the database. Also the not-null annotation does not help me...

      Any ideas?

      Thanks!!!