0 Replies Latest reply on Jan 16, 2007 3:39 PM by codelion

    extending EntityQuery by override or by constructor ?

    codelion

      I've seen both kind of code:

      public class PotatoQuery extends EntityQuery {
      
      public PotatoQuery() {
       setEjbql("SELECT potato FROM Potato potato");
      }


      as well as

      @Override
      public String getEjbql() {
       return "SELECT potato FROM Potato potato";
      }


      Are both equally valid? Fyi, override example is from recent seam-gen.

      Now it seems e.g. for setOrder one would want to use the constructor, because it may change.