Examples of AccountPK


Examples of org.jboss.test.cts.keys.AccountPK

               ps.setString(1, guysName);

               ResultSet rs = ps.executeQuery();

               while (rs.next())
                  result.add(new AccountPK(rs.getString(1)));

               return result;
            }
            finally
            {
View Full Code Here

Examples of org.jboss.test.cts.keys.AccountPK

            ps = con.prepareStatement("SELECT accountNumber,name " +
               "FROM " + TABLE_NAME + " " +
               "WHERE accountNumber=?");
            try
            {
               AccountPK pk = (AccountPK) ctx.getPrimaryKey();

               ps.setString(1, pk.getKey());
               ResultSet rs = ps.executeQuery();

               if (rs.next() == false)
                  throw new NoSuchEntityException("Instance " + pk.getKey() +
                     " not found in database.");

               accountNumber = rs.getString(1);
               personsName = rs.getString(2);
            }
View Full Code Here

Examples of org.jboss.test.cts.keys.AccountPK

   public void testEntityIdentity() throws Exception
   {
      InitialContext ctx = new InitialContext();
      CtsCmpLocalHome home = (CtsCmpLocalHome) ctx.lookup("ejbcts/LocalCMPBean");
      AccountPK key1 = new AccountPK("1");
      CtsCmpLocal bean1 = null;
      try
      {
         bean1 = home.create(key1, "testEntityIdentity");
      }
      catch(DuplicateKeyException e)
      {
         bean1 = home.findByPrimaryKey(key1);
      }
      AccountPK key2 = new AccountPK("2");
      CtsCmpLocal bean2 = null;
      try
      {
         bean2 = home.create(key2, "testEntityIdentity");
      }
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.