6 Replies Latest reply on Aug 8, 2003 4:07 PM by rakhbari

    can someone post isModified method

    atatinen

      i am not sure if my earlier messages made through to the forum...pardon me for multiple posts about the same thing.

      can some one post how to deploy the isModified method in JBoss. i mean do we need to add an entry for that in some deployment file?

        • 1. Re: can someone post isModified method

          You need to implement the method boolean isModified() in your bean. JBoss will check the existence of this method in the bean implementation and call it at appropriate times.

          • 2. Re: can someone post isModified method
            p_d_austin

            public class MyBean .... {
            private boolean modified;

            public boolean isModified() {
            return modified;
            }

            public void setField(String field) {
            this.field = field;
            moidified = true;
            }

            public void ejbStore() {
            modified = false;
            }
            }

            • 3. Re: can someone post isModified method
              jamaladdin

              public boolean isModified(){
              System.out.println("Meslehet - "+modified);
              if (modified) {
              modified=false;
              }
              return !modified;
              }

              Jamal Hasanov
              www.j-think.com

              • 4. Re: can someone post isModified method
                jamaladdin

                Sorry, the correct decaration is

                public boolean isModified(){
                if (modified) {
                modified=false;
                return true;
                }
                else
                return false;
                }

                Jamal Hasanov
                www.j-think.com

                • 5. Re: can someone post isModified method
                  hcguersoy

                  Hi Folks!

                  > You need to implement the method boolean isModified()
                  > in your bean. JBoss will check the existence of this
                  > method in the bean implementation and call it at
                  > appropriate times.

                  Is this functionality aviable in JBoss 3.0.4 (or later)? I have looked in all docs i have for 3.0 and the last statement i found was in a doc-file for 3.0a.

                  How this is handled in newer JBoss-versions?

                  Thanks!

                  • 6. Re: can someone post isModified method
                    rakhbari

                    > Hi Folks!
                    >
                    > > You need to implement the method boolean
                    > isModified()
                    > > in your bean. JBoss will check the existence of
                    > this
                    > > method in the bean implementation and call it at
                    > > appropriate times.
                    >
                    > Is this functionality aviable in JBoss 3.0.4 (or
                    > later)? I have looked in all docs i have for 3.0 and
                    > the last statement i found was in a doc-file for
                    > 3.0a.
                    >
                    > How this is handled in newer JBoss-versions?
                    >
                    > Thanks!

                    I've done several tests now and at least JBoss 3.2.1 CMP completely ignores the isModified() method. I ended up having to modify the XDoclet template so that it inserts the call to isModified() and makeClean() in the generated xxxxxxCMP.java class. JBoss appears to call ejbStore() regardless, but at least now my code does a call to isModified() and immediately returns if it returns false.

                    -RA