2 Replies Latest reply on Jun 9, 2008 12:55 AM by Mallikarjun SG

    required remove method functionality and code

    Mallikarjun SG Newbie

      Hi,

      I would need code for remove method functionality in CMP Bean. I am using EJB 2.0.

      1. What is the return type of remove method when calling from session bean.
      2. when passing the primary key in remove method to remove the record from the table. how should the query to be written in the ejb-jar.xml

      Please send me all these details.

      Thank you,
      Mallikarjun.

        • 1. Re: required remove method functionality and code
          Mallikarjun SG Newbie

          Hi,

          My scenario is to delete a record from the table.

          I am using client and calling session facade, from session facade calling CMP Home Interface remove method by passing "primary key" value. Bean ejbRemove method is also having the same "primary key" parameter. In the method body, do I need to call set method of that primary key? do I need to write any query for this method in the ejb-jar.xml

          Please help me out.

          Thank you,
          Mallikarjun.

          • 2. Re: required remove method functionality and code
            Mallikarjun SG Newbie


            when trying to remove a record from the DB. I am using findByPrimaryKey(id) method and then calling home.remove method, but while deployment I am getting the following error. Please help me out to remove the record from DB.


            10:01:14,271 WARN [verifier] EJB spec violation:
            Bean : RCVlanHome
            Method : public abstract void remove() throws RemoveException, EJBException
            Section: 12.2.11
            Warning: Each local home method must match a method defined in the entity bean class.

            10:01:14,302 ERROR [MainDeployer] could not create deployment: file:/C:/jboss-4.0.2/server/default/deploy/sasemsProj.jar
            org.jboss.deployment.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.
            at org.jboss.ejb.EJBDeployer.create(EJBDeployer.java:553)
            at org.jboss.deployment.MainDeployer.create(MainDeployer.java:918)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:774)
            at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:738)
            at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)