0 Replies Latest reply on Feb 1, 2005 3:03 PM by Fiona Healy

    pk autogeneration

    Fiona Healy Newbie

      Hey,

      I was hard-coding ids for an entity bean called report. I was retrieving all previously defined report names from the db in order to populate a list on the GUI, i used the following for-loop as follows:

      for(int i = 1; ; i++)
      {
      Integer pk = new Integer(i);
      ReportDefinitionRemote report;
      report = home.findByPrimaryKey(pk)
      }

      //add report to a vector

      Since i changed to using an auto generate method to generate pks using the code:
      return new Integer((new Object()).hashCode())
      its not returning any of the report names. Any other looping constructs i could use or a reason why this one is not working any more? Is there a getAll() method i could use?