Package com.titan.cabin

Examples of com.titan.cabin.CabinHomeRemote.findByPrimaryKey()


            // Add 10 cabins to deck 4 of ship 3.
            makeCabins(home, 91, 100, 4, 3);

            for (int i = 1; i <= 100; i++){
                Integer pk = new Integer(i);
                CabinRemote cabin = home.findByPrimaryKey(pk);
                System.out.println("PK = "+i+", Ship = "+cabin.getShipId()
                  + ", Deck = "+cabin.getDeckLevel()
                  + ", BedCount = "+cabin.getBedCount()
                  + ", Name = "+cabin.getName());
            }
View Full Code Here


            cabin_1.setBedCount(3);

               
            Integer pk = new Integer(1);
           
            CabinRemote cabin_2 = home.findByPrimaryKey(pk);
            System.out.println(cabin_2.getName());
            System.out.println(cabin_2.getDeckLevel());
            System.out.println(cabin_2.getShipId());
            System.out.println(cabin_2.getBedCount());
View Full Code Here

        PortableRemoteObject.narrow(ref,CabinHomeRemote.class);

      System.out.println("Testing serialization of EJBObject handle");

      Integer pk_1 = new Integer(100);
      CabinRemote cabin_1 = home.findByPrimaryKey(pk_1);

      // Serialize the Handle for cabin 100 to a file.
      Handle handle = cabin_1.getHandle();
      FileOutputStream fos = new FileOutputStream("handle100.ser");
      ObjectOutputStream outStream = new ObjectOutputStream(fos);
View Full Code Here

      CabinHomeRemote home2 = (CabinHomeRemote)
        PortableRemoteObject.narrow(hometemp,CabinHomeRemote.class);


      System.out.println("Acquiring reference to bean using new Home interface...");
      CabinRemote cabin_3 = home2.findByPrimaryKey(pk_1);

      // Test that we end up with the same bean after finding it through this home
      if(cabin_1.isIdentical(cabin_3)) {
        System.out.println("cabin_1.isIdentical(cabin_3) returns true - This is correct");
      } else {
View Full Code Here

            Vector vect = new Vector();
            for (int i = 1; ; i++) {
              Integer pk = new Integer(i);
              CabinRemote cabin = null;
              try {
                  cabin = home.findByPrimaryKey(pk);
                } catch(javax.ejb.FinderException fe) {
                    System.out.println("Caught exception: "+fe.getMessage()+" for pk="+i);

                    break;
                }
View Full Code Here

            Vector vect = new Vector();
            for (int i = 1; ; i++) {
              Integer pk = new Integer(i);
              CabinRemote cabin = null;
              try {
                  cabin = home.findByPrimaryKey(pk);
                } catch(javax.ejb.FinderException fe) {
                    System.out.println("Caught exception: "+fe.getMessage()+" for pk="+i);

                    break;
                }
View Full Code Here

      if (primKeyType.getName().equals("java.lang.Integer")) {
        Integer pk = new Integer(1);
        Object ref2 = meta.getEJBHome();
        CabinHomeRemote c_home2 = (CabinHomeRemote)
          PortableRemoteObject.narrow(ref2,CabinHomeRemote.class);
        CabinRemote cabin = c_home2.findByPrimaryKey(pk);
        System.out.println(cabin.getName());
      }
       
        } catch(java.rmi.RemoteException re){re.printStackTrace();}
          catch(Throwable t){t.printStackTrace();}
View Full Code Here

            // Add 10 cabins to deck 4 of ship 3.
            makeCabins(home, 91, 100, 4, 3);

            for (int i = 1; i <= 100; i++){
                Integer pk = new Integer(i);
                CabinRemote cabin = home.findByPrimaryKey(pk);
                System.out.println("PK = "+i+", Ship = "+cabin.getShipId()
                  + ", Deck = "+cabin.getDeckLevel()
                  + ", BedCount = "+cabin.getBedCount()
                  + ", Name = "+cabin.getName());
            }
View Full Code Here

            cabin_1.setBedCount(3);

               
            Integer pk = new Integer(1);
           
            CabinRemote cabin_2 = home.findByPrimaryKey(pk);
            System.out.println(cabin_2.getName());
            System.out.println(cabin_2.getDeckLevel());
            System.out.println(cabin_2.getShipId());
            System.out.println(cabin_2.getBedCount());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.