2 Replies Latest reply on Jun 8, 2003 12:41 PM by sailing

    amazing insert SQL generated by JBossCMP

    sailing

      The SQL:
      21:53:18,537 DEBUG [Result] Insert Entity SQL: INSERT INTO result (resultid, stuid, catalogname, score, stuid) VALUES (?, ?, ?, ?, ?)

      but in my ResultBean (CMP) ,the create method only has four parameter.Why the sql has double 'stuid'?

      PS: ResultBean *---1 StudentBean

        • 1. Re: amazing insert SQL generated by JBossCMP
          lafr

          I guess you have stuid twice in your bean and ejb-jar.xml:
          first as a CMP-Field and second in the relation.
          You must not have the first.

          • 2. Re: amazing insert SQL generated by JBossCMP
            sailing

            "first as a CMP-Field and second in the relation.
            You must not have the first"

            I followed u sugguestion,but hava new problem.

            I only remove stuid CMP-Field from ejb-jar.xml,when application run,it occure error like "can not found set method is CMP or CMR method".It generated right SQL,only one stuid.

            If I only emove stuid parameter from ejbCreate method,it still hava double 'stuid' in Insert Entity SQL.

            If I both remove stuid CMP-Field from ejb-jar.xml and stuid parameter from ejbCreate method.It seems generated right SQL,only one stuid,but occure error like "can not found set method is CMP or CMR method".

            How can i do ?I write ejb-jar.xml by using xdoclet.