Examples of CouchDBAssociation


Examples of org.hibernate.ogm.datastore.couchdb.dialect.model.impl.CouchDBAssociation

    removeDocumentIfPresent( Identifier.createEntityId( key ) );
  }

  @Override
  public Association getAssociation(AssociationKey key, AssociationContext associationContext) {
    CouchDBAssociation couchDBAssociation = null;

    if ( isStoredInEntityStructure( key.getMetadata(), associationContext.getAssociationTypeContext() ) ) {
      EntityDocument owningEntity = getDataStore().getEntity( Identifier.createEntityId( key.getEntityKey() ) );
      if ( owningEntity != null && owningEntity.getProperties().containsKey( key.getMetadata().getCollectionRole() ) ) {
        couchDBAssociation = CouchDBAssociation.fromEmbeddedAssociation( owningEntity, key.getMetadata().getCollectionRole() );
View Full Code Here

Examples of org.hibernate.ogm.datastore.couchdb.dialect.model.impl.CouchDBAssociation

    return couchDBAssociation != null ? new Association( new CouchDBAssociationSnapshot( couchDBAssociation, key ) ) : null;
  }

  @Override
  public Association createAssociation(AssociationKey key, AssociationContext associationContext) {
    CouchDBAssociation couchDBAssociation = null;

    if ( isStoredInEntityStructure( key.getMetadata(), associationContext.getAssociationTypeContext() ) ) {
      EntityDocument owningEntity = getDataStore().getEntity( Identifier.createEntityId( key.getEntityKey() ) );
      if ( owningEntity == null ) {
        owningEntity = (EntityDocument) getDataStore().saveDocument( new EntityDocument( key.getEntityKey() ) );
View Full Code Here

Examples of org.hibernate.ogm.datastore.couchdb.dialect.model.impl.CouchDBAssociation

  @Override
  public void insertOrUpdateAssociation(AssociationKey associationKey, Association association, AssociationContext associationContext) {
    List<Object> rows = getAssociationRows( association, associationKey );

    CouchDBAssociation couchDBAssociation = ( (CouchDBAssociationSnapshot) association.getSnapshot() ).getCouchDbAssociation();
    couchDBAssociation.setRows( rows );

    getDataStore().saveDocument( couchDBAssociation.getOwningDocument() );
  }
View Full Code Here

Examples of org.hibernate.ogm.datastore.couchdb.dialect.model.impl.CouchDBAssociation

    removeDocumentIfPresent( Identifier.createEntityId( key ) );
  }

  @Override
  public Association getAssociation(AssociationKey key, AssociationContext associationContext) {
    CouchDBAssociation couchDBAssociation = null;

    if ( isStoredInEntityStructure( key, associationContext ) ) {
      EntityDocument owningEntity = getDataStore().getEntity( Identifier.createEntityId( key.getEntityKey() ) );
      if ( owningEntity != null && owningEntity.getProperties().containsKey( key.getCollectionRole() ) ) {
        couchDBAssociation = CouchDBAssociation.fromEmbeddedAssociation( owningEntity, key.getCollectionRole() );
View Full Code Here

Examples of org.hibernate.ogm.datastore.couchdb.dialect.model.impl.CouchDBAssociation

    return couchDBAssociation != null ? new Association( new CouchDBAssociationSnapshot( couchDBAssociation, key ) ) : null;
  }

  @Override
  public Association createAssociation(AssociationKey key, AssociationContext associationContext) {
    CouchDBAssociation couchDBAssociation = null;

    if ( isStoredInEntityStructure( key, associationContext ) ) {
      EntityDocument owningEntity = getDataStore().getEntity( Identifier.createEntityId( key.getEntityKey() ) );
      if ( owningEntity == null ) {
        owningEntity = (EntityDocument) getDataStore().saveDocument( new EntityDocument( key.getEntityKey() ) );
View Full Code Here

Examples of org.hibernate.ogm.datastore.couchdb.dialect.model.impl.CouchDBAssociation

  @Override
  public void updateAssociation(Association association, AssociationKey associationKey, AssociationContext associationContext) {
    List<Object> rows = getAssociationRows( association, associationKey );

    CouchDBAssociation couchDBAssociation = ( (CouchDBAssociationSnapshot) association.getSnapshot() ).getCouchDbAssociation();
    couchDBAssociation.setRows( rows );

    getDataStore().saveDocument( couchDBAssociation.getOwningDocument() );
  }
View Full Code Here

Examples of org.hibernate.ogm.datastore.couchdb.dialect.model.impl.CouchDBAssociation

    removeDocumentIfPresent( Identifier.createEntityId( key ) );
  }

  @Override
  public Association getAssociation(AssociationKey key, AssociationContext associationContext) {
    CouchDBAssociation couchDBAssociation = null;

    if ( isStoredInEntityStructure( key, associationContext ) ) {
      EntityDocument owningEntity = getDataStore().getEntity( Identifier.createEntityId( key.getEntityKey() ) );
      if ( owningEntity != null && owningEntity.getProperties().containsKey( key.getCollectionRole() ) ) {
        couchDBAssociation = CouchDBAssociation.fromEmbeddedAssociation( owningEntity, key.getCollectionRole() );
View Full Code Here

Examples of org.hibernate.ogm.datastore.couchdb.dialect.model.impl.CouchDBAssociation

    return couchDBAssociation != null ? new Association( new CouchDBAssociationSnapshot( couchDBAssociation, key ) ) : null;
  }

  @Override
  public Association createAssociation(AssociationKey key, AssociationContext associationContext) {
    CouchDBAssociation couchDBAssociation = null;

    if ( isStoredInEntityStructure( key, associationContext ) ) {
      EntityDocument owningEntity = getDataStore().getEntity( Identifier.createEntityId( key.getEntityKey() ) );
      if ( owningEntity == null ) {
        owningEntity = (EntityDocument) getDataStore().saveDocument( new EntityDocument( key.getEntityKey() ) );
View Full Code Here

Examples of org.hibernate.ogm.datastore.couchdb.dialect.model.impl.CouchDBAssociation

  @Override
  public void updateAssociation(Association association, AssociationKey associationKey, AssociationContext associationContext) {
    List<Map<String, Object>> rows = getAssociationRows( association, associationKey );

    CouchDBAssociation couchDBAssociation = ( (CouchDBAssociationSnapshot) association.getSnapshot() ).getCouchDbAssociation();
    couchDBAssociation.setRows( rows );

    getDataStore().saveDocument( couchDBAssociation.getOwningDocument() );
  }
View Full Code Here

Examples of org.hibernate.ogm.datastore.couchdb.dialect.model.impl.CouchDBAssociation

    removeDocumentIfPresent( Identifier.createEntityId( key ) );
  }

  @Override
  public Association getAssociation(AssociationKey key, AssociationContext associationContext) {
    CouchDBAssociation couchDBAssociation = null;

    if ( isStoredInEntityStructure( key, associationContext ) ) {
      EntityDocument owningEntity = getDataStore().getEntity( Identifier.createEntityId( key.getEntityKey() ) );
      if ( owningEntity != null && owningEntity.getProperties().containsKey( key.getCollectionRole() ) ) {
        couchDBAssociation = CouchDBAssociation.fromEmbeddedAssociation( owningEntity, key.getCollectionRole() );
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.