1 Reply Latest reply on Nov 9, 2003 9:54 PM by Juha Lindfors

    EJB/Jboss-update a field according to id received from user

    null null Newbie

      hi,
      below is a part of my program. i try to get a value from user, than compare it with id field in my hotel bean, and then assign a new value to other field called Status. But when i build, there is no error but the program display exception error when i compile it.There is no value is updated in the Status field when i view backed all the records in hotel bean. any help is appreciated. thanks in advance...
      note : i am using Jboss server and XDoclet

      HotelEntityHome lHome1 = (HotelEntityHome) PortableRemoteObject.narrow(
      lContext.lookup(
      "java:comp/env/ejb/myhotel/HotelEntity"
      ),
      HotelEntityHome.class
      );
      // Create a new Booking Entity and return its Id

      HotelEntityData lData1 = new HotelEntityData();

      HotelEntity lEntity1 = lHome1.create( lData1 );

      int Hotel_ID = Integer.parseInt(pHotelID);

      HotelEntity allData = lHome1.findById(Hotel_ID);

      String StatusRoom = "Occupied";
      lData1 = allData.getValueObject();
      if (lData1.getId()==(Hotel_ID))
      {
      lData1.setStatus(StatusRoom);
      }