0 Replies Latest reply on Jul 8, 2010 10:13 AM by jkleiser

    Null elements in fetched List

    jkleiser
      In one of the entities in our Seam application we do this:

      @OneToMany(fetch = FetchType.EAGER, cascade=CascadeType.ALL)
      @OrderBy("prioritetsNummer ASC")
      @IndexColumn(name="prioritetsnr", base=1)
      @JoinColumns( {
        @JoinColumn(name = ..., referencedColumnName = ..., insertable = false, updatable = false),
        ...
      })
      private List<XYZ> xyzList = new ArrayList<XYZ>();

      Now we experience that the xyzList sometimes may contain one or more null elements, which causes NullPointerExceptions in several places. Can this be fixed by modifying the annotations? If not, what would be the best way to remove the null elements from xyzList?

      /Jon