Package org.hibernate.ogm.datastore.ehcache.dialect.impl

Examples of org.hibernate.ogm.datastore.ehcache.dialect.impl.SerializableKey


  }

  @Override
  public Tuple getTuple(EntityKey key, TupleContext tupleContext) {
    final Cache<SerializableKey> entityCache = datastoreProvider.getEntityCache();
    final Element element = entityCache.get( new SerializableKey( key ) );
    if ( element != null ) {
      return createTuple( element );
    }
    else {
      return null;
View Full Code Here


  @Override
  public Tuple createTuple(EntityKey key, TupleContext tupleContext) {
    final Cache<SerializableKey> entityCache = datastoreProvider.getEntityCache();
    final HashMap<String, Object> tuple = new HashMap<String, Object>();
    entityCache.put( new Element( new SerializableKey( key ), tuple ) );

    return new Tuple( new MapTupleSnapshot( tuple ) );
  }
View Full Code Here

  public void updateTuple(Tuple tuple, EntityKey key, TupleContext tupleContext) {
    Map<String, Object> entityRecord = ( (MapTupleSnapshot) tuple.getSnapshot() ).getMap();
    MapHelpers.applyTupleOpsOnMap( tuple, entityRecord );

    final Cache<SerializableKey> entityCache = datastoreProvider.getEntityCache();
    entityCache.put( new Element( new SerializableKey( key ), entityRecord ) );
  }
View Full Code Here

    entityCache.put( new Element( new SerializableKey( key ), entityRecord ) );
  }

  @Override
  public void removeTuple(EntityKey key, TupleContext tupleContext) {
    datastoreProvider.getEntityCache().remove( new SerializableKey( key ) );
  }
View Full Code Here

  }

  @Override
  public Association getAssociation(AssociationKey key, AssociationContext associationContext) {
    final Cache<SerializableKey> associationCache = datastoreProvider.getAssociationCache();
    final Element element = associationCache.get( new SerializableKey( key ) );

    if ( element == null ) {
      return null;
    }
    else {
View Full Code Here

  @Override
  public Association createAssociation(AssociationKey key, AssociationContext associationContext) {
    final Cache<SerializableKey> associationCache = datastoreProvider.getAssociationCache();
    Map<SerializableKey, Map<String, Object>> association = new HashMap<SerializableKey, Map<String, Object>>();
    associationCache.put( new Element( new SerializableKey( key ), association ) );
    return new Association( new SerializableMapAssociationSnapshot( association ) );
  }
View Full Code Here

      switch ( action.getType() ) {
        case CLEAR:
          associationRows.clear();
        case PUT_NULL:
        case PUT:
          associationRows.put( new SerializableKey( action.getKey() ), MapHelpers.tupleToMap( action.getValue() ) );
          break;
        case REMOVE:
          associationRows.remove( new SerializableKey( action.getKey() ) );
          break;
      }
    }

    final Cache<SerializableKey> associationCache = datastoreProvider.getAssociationCache();
    associationCache.put( new Element( new SerializableKey( key ), associationRows ) );
  }
View Full Code Here

    associationCache.put( new Element( new SerializableKey( key ), associationRows ) );
  }

  @Override
  public void removeAssociation(AssociationKey key, AssociationContext associationContext) {
    datastoreProvider.getAssociationCache().remove( new SerializableKey( key ) );
  }
View Full Code Here

  }

  @Override
  public void nextValue(RowKey rowKey, IntegralDataTypeHolder value, int increment, int initialValue) {
    final Cache<SerializableKey> cache = datastoreProvider.getIdentifierCache();
    SerializableKey key = new SerializableKey( rowKey );

    Element previousValue = cache.get( key );
    if ( previousValue == null ) {
      previousValue = cache.putIfAbsent( new Element( key, initialValue ) );
    }
View Full Code Here

  }

  @Override
  public Tuple getTuple(EntityKey key, TupleContext tupleContext) {
    final Cache<SerializableKey> entityCache = datastoreProvider.getEntityCache();
    final Element element = entityCache.get( new SerializableKey( key ) );
    if ( element != null ) {
      return createTuple( element );
    }
    else {
      return null;
View Full Code Here

TOP

Related Classes of org.hibernate.ogm.datastore.ehcache.dialect.impl.SerializableKey

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.