2 Replies Latest reply on Apr 7, 2005 11:36 PM by spoonman464

    Find By Primary Key Query

    richardzheng Newbie

      I got an error like this:[org.jboss.ejb.plugins.cmp.jdbc.JDBCFindByPrimaryKeyQuery.User#findByPrimaryKey] Executing SQL: SELECT t0_User.OID FROM USER t0_User WHERE t0_User.OID=? when I tried to retrieve a record by primary key.

      It is fine to insert a record.

      The envieronment is Jboss 4.0.1 and Oracle 8i.

      Thanks in advance


        • 1. Re: Find By Primary Key Query
          Wessel de Roode Newbie

          Think you need to post more information about your code.
          There is nothing to tell only about the error.
          Post your Xdoclet tag that was used for your finder.

          My gues is that u probaly used plain SQL for your finder instead of QL :-)

          Wessel de Roode

          • 2. It's just a standard findByPrimaryKey(pk) method, yes?
            spoonman464 Newbie

            Did you write code for this query? It's my understanding that you never have to write any SQL or EJB-QL for either findAll() or findByPrimaryKey() If you have written some SQL or EJB-QL, maybe you are making problems for yourself.

            public ComponentIntf findByPrimaryKey(primaryKeyDataType pk) throws RemoteException, FinderException;

            in the Home interface should be enough to make it work. At least I've never done anything more than that and mine work all the time.