2 Replies Latest reply on Nov 14, 2008 9:56 AM by Rene Felgenträger

    Differences between @PostCreate and @Create

    Rene Felgenträger Newbie

      I always thought that the PostCreate (applied on a seam-pojo!!!) is the equvialent of @Create (applied on a seam-pojo). But it seems not. Let me explain.

      On my pojo extending from EntityQuery I use the @PostCreate as a workaround for setting the restrictions (remember @Create is already in use by the Query-class).

      My code looks like this:

          private AbstractCompanySuggBoxController abstractCompanySuggBoxController;
          private Log log; 
          public void initRestrictions() {
               this.log.info("init restrictions");
               this.log.info("AbstractCompany: #0", this.abstractCompanySuggBoxController);        <===== Log available, but NOT my Pojo!!!

      Later my pojo is available

          public String getRenderedEjbql() {
               this.log.info("abstract: #0", this.abstractCompanySuggBoxController);             <===== NOW my pojo is available!!!
               return super.getRenderedEjbql();

      So, why is the @Logger available after @PostConstruct, but my pojo not??? The thing is when I use @Create (and overriding the validate-Method in class Query)
      the logger AND pojo are injected properly.