Examples of MyEntity


Examples of org.dayatang.springtest.domain.MyEntity

  @Override
  public List<MyEntity> getMyTrueEntityList() {
        List<MyEntity> results = new ArrayList<MyEntity>();
        for (int i = 1; i < 5; i++) {

            MyEntity entity = new MyEntity();

            entity.setName("entity" + i);
            entity.setVersion(1);

            results.add(entity);
        }

        return results;
View Full Code Here

Examples of org.hibernate.test.jpa.MyEntity

    Session s1 = getSessions().openSession();
    Transaction t1 = s1.beginTransaction();
    Item item = new Item();
    item.setName( initialName );
    s1.save( item );
    MyEntity myEntity = new MyEntity();
    myEntity.setName( "Test" );
    s1.save( myEntity );
    t1.commit();
    s1.close();

    Long itemId = item.getId();
    long initialVersion = item.getVersion();

    s1 = getSessions().openSession();
    t1 = s1.beginTransaction();
    item = (Item) s1.get( Item.class, itemId );
    s1.lock( item, LockMode.FORCE );
    assertEquals( "no forced version increment", initialVersion + 1, item.getVersion() );

    myEntity = (MyEntity) s1.get( MyEntity.class, myEntity.getId() );
    s1.lock( myEntity, LockMode.FORCE );
    assertTrue( "LockMode.FORCE on a un-versioned entity should degrade nicely to UPGRADE", true );

    s1.lock( item, LockMode.FORCE );
    assertEquals( "subsequent LockMode.FORCE did not no-op", initialVersion + 1, item.getVersion() );
View Full Code Here

Examples of org.hibernate.test.jpa.MyEntity

    Session s1 = getSessions().openSession();
    Transaction t1 = s1.beginTransaction();
    Item item = new Item();
    item.setName( initialName );
    s1.save( item );
    MyEntity myEntity = new MyEntity();
    myEntity.setName( "Test" );
    s1.save( myEntity );
    t1.commit();
    s1.close();

    Long itemId = item.getId();
    long initialVersion = item.getVersion();

    s1 = getSessions().openSession();
    t1 = s1.beginTransaction();
    item = (Item) s1.get( Item.class, itemId );
    s1.lock( item, LockMode.FORCE );
    assertEquals( "no forced version increment", initialVersion + 1, item.getVersion() );

    myEntity = (MyEntity) s1.get( MyEntity.class, myEntity.getId() );
    s1.lock( myEntity, LockMode.FORCE );
    assertTrue( "LockMode.FORCE on a unversioned entity should degrade nicely to UPGRADE", true );

    s1.lock( item, LockMode.FORCE );
    assertEquals( "subsequent LockMode.FORCE did not no-op", initialVersion + 1, item.getVersion() );
View Full Code Here

Examples of org.hibernate.test.jpa.MyEntity

    Session s1 = getSessions().openSession();
    Transaction t1 = s1.beginTransaction();
    Item item = new Item();
    item.setName( initialName );
    s1.save( item );
    MyEntity myEntity = new MyEntity();
    myEntity.setName( "Test" );
    s1.save( myEntity );
    t1.commit();
    s1.close();

    Long itemId = item.getId();
    long initialVersion = item.getVersion();

    s1 = getSessions().openSession();
    t1 = s1.beginTransaction();
    item = ( Item ) s1.get( Item.class, itemId );
    s1.lock( item, LockMode.FORCE );
    assertEquals( "no forced version increment", initialVersion + 1, item.getVersion() );

    myEntity = (MyEntity) s1.get( MyEntity.class, myEntity.getId() );
    s1.lock( myEntity, LockMode.FORCE );
    assertTrue( "LockMode.FORCE on a unversioned entity should degrade nicely to UPGRADE", true );


    s1.lock( item, LockMode.FORCE );
View Full Code Here

Examples of org.jbpm.persistence.session.objects.MyEntity

        if( utx.getStatus() == Status.STATUS_ACTIVE ) {
            utx.commit();
        }
      
        // Setup entities
        MyEntity myEntity = new MyEntity("This is a test Entity with annotation in fields");
        MyEntityMethods myEntityMethods = new MyEntityMethods("This is a test Entity with annotations in methods");
        MyEntityOnlyFields myEntityOnlyFields = new MyEntityOnlyFields("This is a test Entity with annotations in fields and without accesors methods");
        MyVariableSerializable myVariableSerializable = new MyVariableSerializable("This is a test SerializableObject");

        // persist entities
View Full Code Here

Examples of org.jbpm.persistence.session.objects.MyEntity

  }

  @Test
    public void testPersistenceVariablesWithTypeChange() throws NamingException, NotSupportedException, SystemException, RollbackException, HeuristicMixedException, HeuristicRollbackException {

        MyEntity myEntity = new MyEntity("This is a test Entity with annotation in fields");
        MyEntityMethods myEntityMethods = new MyEntityMethods("This is a test Entity with annotations in methods");
        MyEntityOnlyFields myEntityOnlyFields = new MyEntityOnlyFields("This is a test Entity with annotations in fields and without accesors methods");
        MyVariableSerializable myVariableSerializable = new MyVariableSerializable("This is a test SerializableObject");

        Cache<String, Object> cache = cm.getCache("jbpm-configured-cache");
View Full Code Here

Examples of org.jbpm.persistence.session.objects.MyEntity

    }
   
    @Test
    public void testPersistenceVariablesSubProcess() throws NamingException, NotSupportedException, SystemException, RollbackException, HeuristicMixedException, HeuristicRollbackException {
       
        MyEntity myEntity = new MyEntity("This is a test Entity with annotation in fields");
        MyEntityMethods myEntityMethods = new MyEntityMethods("This is a test Entity with annotations in methods");
        MyEntityOnlyFields myEntityOnlyFields = new MyEntityOnlyFields("This is a test Entity with annotations in fields and without accesors methods");
        MyVariableSerializable myVariableSerializable = new MyVariableSerializable("This is a test SerializableObject");
        Cache<String, Object> cache = cm.getCache("jbpm-configured-cache");
        UserTransaction utx = (UserTransaction) cache.getAdvancedCache().getTransactionManager();
View Full Code Here

Examples of org.jbpm.persistence.session.objects.MyEntity

        assertNull( processInstance );
    }
   
    @Test
    public void testWorkItemWithVariablePersistence() throws Exception{
        MyEntity myEntity = new MyEntity("This is a test Entity");
        MyVariableSerializable myVariableSerializable = new MyVariableSerializable("This is a test SerializableObject");
        Cache<String, Object> cache = cm.getCache("jbpm-configured-cache");
        UserTransaction utx = (UserTransaction) cache.getAdvancedCache().getTransactionManager();
        utx.begin();
       
View Full Code Here

Examples of org.jbpm.persistence.session.objects.MyEntity

      assertEquals(3L, InfinispanPlaceholderResolverStrategy.getClassIdValue(subEntity));
    }
   
    @Test
    public void testAbortWorkItemWithVariablePersistence() throws Exception{
        MyEntity myEntity = new MyEntity("This is a test Entity");
        MyVariableSerializable myVariableSerializable = new MyVariableSerializable("This is a test SerializableObject");
        Cache<String, Object> cache = cm.getCache("jbpm-configured-cache");
        UserTransaction utx = (UserTransaction) cache.getAdvancedCache().getTransactionManager();
        utx.begin();
       
View Full Code Here

Examples of org.sonatype.mavenbook.ch03.model.MyEntity

      // entity manager because they share the same underlying connection object.
      // When trace is on, you'll see the SOAP requests and responses on stdout.
      connector.getConnection().getConfig().setTraceMessage(true);
      connector.getConnection().getConfig().setPrettyPrintXml(true);

      MyEntity entity = new MyEntity();
      entity.setName("A Test Entity");

      entityService.save(entity);
     
      assertNotNull(entity.getId());
      entityId = entity.getId();

      entity = entityService.findEntity(entityId);
     
      assertEquals("A Test Entity", entity.getName());
     
      entity.setName("A Modified Test Entity");
     
      entityService.save(entity);

      entity = entityService.findEntity(entityId);
     
      assertEquals("A Modified Test Entity",entity.getName());

      entityService.delete(entityId);
     
      entity = entityService.findEntity(entityId);
     
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.