Examples of findByPrimaryKey()


Examples of org.jboss.test.hello.interfaces.LocalHelloLogHome.findByPrimaryKey()

      }
      catch(DuplicateKeyException e)
      {
         try
         {
            bean = home.findByPrimaryKey(name);
            log.info("Found LocalHelloLog with key="+name);
            if( bean != null )
               bean.setStartTime(begin);
         }
         catch(FinderException fe)
View Full Code Here

Examples of org.jboss.test.invokers.interfaces.SimpleBMPHome.findByPrimaryKey()

      InitialContext ctx = new InitialContext();
      SimpleBMPHome home1 = (SimpleBMPHome)ctx.lookup("SimpleBMP");
      SimpleBMPHome home2 = (SimpleBMPHome)ctx.lookup("CompressionSimpleBMP");

      SimpleBMP bmp1 = home1.create(1, "bill");
      SimpleBMP bmp2 = home2.findByPrimaryKey(new Integer(1)); // should find it.

      getLog().debug("");
      getLog().debug("bmp1 name: " + bmp1.getName());
      getLog().debug("bmp2 name: " + bmp2.getName());
      getLog().debug("setting name to burke");
View Full Code Here

Examples of org.jboss.test.jca.bank.interfaces.AccountLocalHome.findByPrimaryKey()

   public int getAccountBalance(Integer id)
   {
      try
      {
         AccountLocalHome home = (AccountLocalHome)new InitialContext().lookup("AccountLocal");
         AccountLocal a = home.findByPrimaryKey(id);
         return a.getBalance();
      } catch (Exception e)
      {
         Logger.getLogger(getClass().getName()).info("getAccountBalance failed", e);
         throw new EJBException("Could not get account for id " + id, e);
View Full Code Here

Examples of org.jboss.test.lock.interfaces.EnterpriseEntityHome.findByPrimaryKey()

         log.debug("setNextEntity: " + beanName);
         EJBObject ejbObject = entityContext.getEJBObject();
         EnterpriseEntityHome home = (EnterpriseEntityHome) ejbObject.getEJBHome();
         try
         {
            nextEntity = home.findByPrimaryKey(beanName);
         }
         catch (FinderException e)
         {
            nextEntity = home.create(beanName);
         }
View Full Code Here

Examples of org.jboss.test.security.interfaces.EntityHome.findByPrimaryKey()

        String echo = null;
        try
        {
            InitialContext ctx = new InitialContext();
            EntityHome home = (EntityHome) ctx.lookup("java:comp/env/ejb/Entity");
            Entity bean = home.findByPrimaryKey(arg);
            echo = bean.echo(arg);
        }
        catch(Exception e)
        {
            log.debug("Entity.echo failed", e);
View Full Code Here

Examples of org.jboss.test.testbean.interfaces.EnterpriseEntityHome.findByPrimaryKey()

         StatelessSessionHome slHome = (StatelessSessionHome)ctx.lookup("java:comp/env/ejb/stateless");
         statelessSession = slHome.create();
        
         EnterpriseEntityHome eeHome = (EnterpriseEntityHome)ctx.lookup("java:comp/env/ejb/entity");
         try {
            enterpriseEntity = eeHome.findByPrimaryKey(aString);
         } catch (FinderException e) {
            enterpriseEntity = eeHome.create(aString);
         }
     
      } catch (Exception e) {
View Full Code Here

Examples of org.jboss.test.testbean.interfaces.EntityPKHome.findByPrimaryKey()

      EntityPK pkBean = null;

      // Let's try to find the instance
      try {

         pkBean =  pkHome.findByPrimaryKey(new AComplexPK(true, 10, 100, 1000.0, "Marc"));
      } catch (Exception e) {

         getLog().debug("not found");
         getLog().debug(++test+"- "+"Did not find the instance will create it...");
         pkBean = pkHome.create(true, 10,100, 1000.0, "Marc");
View Full Code Here

Examples of org.jboss.test.testbean2.interfaces.AllTypesHome.findByPrimaryKey()

      getLog().debug(++test+"- "+"Calling findByPrimaryKey on AllTypesHome with name seb...");

      AllTypes allTypes = null;
      try {
         allTypes = allTypesHome.findByPrimaryKey("seb");
      }
      catch (Exception e) {getLog().debug(e.getMessage());}
      if (allTypes == null) {

         getLog().debug("not found OK");
View Full Code Here

Examples of org.jboss.test.threading.interfaces.EJBThreadsHome.findByPrimaryKey()

         
               ejbTest = null;
         
               try {
           
                  ejbTest = testHome.findByPrimaryKey("test1");
               }
               catch (Exception e)
               {
                  // Bean wasn't found create it
                  try {
View Full Code Here

Examples of org.jboss.test.txtimer.interfaces.TimerEntityHome.findByPrimaryKey()

   public void rollbackAfterCreateEntity(long duration)
           throws Exception
   {
      InitialContext iniCtx = new InitialContext();
      TimerEntityHome home = (TimerEntityHome) iniCtx.lookup(TimerEntityHome.JNDI_NAME);
      TimerEntity bean = home.findByPrimaryKey(new Integer(1));
      bean.createTimer(duration, 0, null);
      context.setRollbackOnly();
   }

   /**
 
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.