Package org.jboss.test.hibernate.model

Examples of org.jboss.test.hibernate.model.Name


         {
            service = home.create();

            User user = new User();
            user.setEmail("nobody@nowhere.com");
            user.setName( new Name() );
            user.getName().setFirstName("John");
            user.getName().setInitial( new Character('Q') );
            user.getName().setLastName("Public");
            user.setPassword("password");
            user.setTimeOfCreation( new GregorianCalendar() );
            user.setHandle("myHandle");

            Long savedUserId = service.storeUser( user ).getId();
            getLog().info("User created with id = " + savedUserId );

            // make *sure* it gets loaded into cache.  This is to check
            // that JBossCache as 2nd-level cache is properly releasing
            // resources on SF shutdown; I have manually verified this is
            // the case w/o JBossCache as the 2nd-level cache (i.e. this
            // test case passes w/o JBossCache in the mix).
            List users = service.listUsers();
            assertNotNull( users );
            assertEquals( "Incorrect result size", 1, users.size() );
         }
         finally
         {
            if ( service != null )
            {
               try
               {
                  service.remove();
               }
               catch( Throwable t )
               {
               }
            }
         }
      }
      catch( Throwable t )
      {
         // ignore; does not really matter if this stuff fails/succeeds
         // simply store the original failure so that we can use it later
         initialThrowable = t;
      }

      // force a redeploy
      delegate.redeploy( "hib-test.ear" );

      // then, do some more work...
      ProfileServiceHome home = ProfileServiceUtil.getHome();
      ProfileService service = null;
      try
      {
         service = home.create();

         User user = new User();
         user.setEmail("nobody@nowhere.com");
         user.setName( new Name() );
         user.getName().setFirstName("John");
         user.getName().setInitial( new Character('Q') );
         user.getName().setLastName("Public");
         user.setPassword("password");
         user.setTimeOfCreation( new GregorianCalendar() );
View Full Code Here


      {
         service = home.create();

         User user = new User();
         user.setEmail("nobody@nowhere.com");
         user.setName( new Name() );
         user.getName().setFirstName("John");
         user.getName().setInitial( new Character('Q') );
         user.getName().setLastName("Public");
         user.setPassword("password");
         user.setTimeOfCreation( new GregorianCalendar() );
View Full Code Here

TOP

Related Classes of org.jboss.test.hibernate.model.Name

Copyright © 2018 www.massapicom. 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.