Package org.hibernate.test.cache.infinispan.functional

Examples of org.hibernate.test.cache.infinispan.functional.Citizen


      }
      fail("Citizen (" + id + ") should have present in the cache");
   }

   private void saveSomeCitizens(TransactionManager tm, final SessionFactory sf) throws Exception {
      final Citizen c1 = new Citizen();
      c1.setFirstname( "Emmanuel" );
      c1.setLastname( "Bernard" );
      c1.setSsn( "1234" );

      final State france = new State();
      france.setName( "Ile de France" );
      c1.setState( france );

      final Citizen c2 = new Citizen();
      c2.setFirstname( "Gavin" );
      c2.setLastname( "King" );
      c2.setSsn( "000" );
      final State australia = new State();
      australia.setName( "Australia" );
      c2.setState( australia );

      withTx(tm, new Callable<Void>() {
         @Override
         public Void call() throws Exception {
            Session s = sf.openSession();
View Full Code Here


            Transaction tx = s.beginTransaction();
            State france = getState(s, "Ile de France");
            Criteria criteria = s.createCriteria( Citizen.class );
            criteria.add( Restrictions.naturalId().set( "ssn", "1234" ).set( "state", france ) );
            criteria.setCacheable( true );
            Citizen c = (Citizen) criteria.uniqueResult();
            s.delete(c);
            // cleanup
            tx.commit();
            s.close();
            return null;
View Full Code Here

TOP

Related Classes of org.hibernate.test.cache.infinispan.functional.Citizen

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.