Package org.hibernate.ogm.datastore.couchdb.dialect.backend.json.impl

Examples of org.hibernate.ogm.datastore.couchdb.dialect.backend.json.impl.Document


    }
  }

  @Test(expected = OptimisticLockException.class)
  public void testUpdatingADocumentWithWrongRevisionNumber() {
    Document createdDocument = dataStore.saveDocument( createEntity() );
    String firstVersion = createdDocument.getRevision();

    createdDocument = dataStore.saveDocument( createdDocument );
    createdDocument.setRevision( firstVersion );

    dataStore.saveDocument( createdDocument );
  }
View Full Code Here


    CouchDBDatastore.newInstance( getDatabaseIdentifierWithUnavailableHost(), true );
  }

  @Test
  public void testDeleteADocument() {
    Document createdDocument = dataStore.saveDocument( createEntity() );
    String createdDocumentId = createdDocument.getId();
    dataStore.deleteDocument( createdDocument.getId(), createdDocument.getRevision() );

    EntityDocument entity = dataStore.getEntity( createdDocumentId );

    assertThat( entity, nullValue() );
  }
View Full Code Here

    assertThat( entity, nullValue() );
  }

  @Test(expected = OptimisticLockException.class)
  public void testDeleteADocumentWithWrongRevision() {
    Document createdDocument = dataStore.saveDocument( createEntity() );
    final String revisionBeforeUpdate = createdDocument.getRevision();

    // saving the document will change its revision value
    dataStore.saveDocument( createdDocument );
    createdDocument.setRevision( revisionBeforeUpdate );

    dataStore.deleteDocument( createdDocument.getId(), createdDocument.getRevision() );
  }
View Full Code Here

    dataStore.deleteDocument( createdDocument.getId(), createdDocument.getRevision() );
  }

  @Test
  public void testGetEntity() {
    Document createdDocument = dataStore.saveDocument( createEntity() );
    EntityDocument entity = dataStore.getEntity( createdDocument.getId() );
    assertThat( entity, notNullValue() );
  }
View Full Code Here

    assertThat( entity, notNullValue() );
  }

  @Test
  public void testGetEntityWithWrongIdReturnNullValue() {
    Document createdDocument = dataStore.saveDocument( createEntity() );
    EntityDocument entity = dataStore.getEntity( createdDocument.getId() + "_1" );
    assertThat( entity, nullValue() );
  }
View Full Code Here

TOP

Related Classes of org.hibernate.ogm.datastore.couchdb.dialect.backend.json.impl.Document

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.