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

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


  SerializableRowKey unmarshall(byte[] bytes) throws Exception {
    InputStream is = new ByteArrayInputStream( bytes );
    ObjectInputStream ois = new ObjectInputStream( is );
    try {
      SerializableRowKey object = (SerializableRowKey) ois.readObject();
      return object;
    }
    finally {
      try {
        ois.close();
View Full Code Here


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

    final Cache<SerializableAssociationKey> associationCache = datastoreProvider.getAssociationCache();
View Full Code Here

  public void shouldSerializeAndDeserializeRowKey() throws Exception {
    String[] columnNames = { "foo", "bar", "baz" };
    Object[] values = { 123, "Hello", 456L };

    // given
    SerializableRowKey key = new SerializableRowKey( new RowKey( columnNames, values ) );

    // when
    byte[] bytes = marshall( key );
    SerializableRowKey unmarshalledKey = unmarshall( bytes );

    // then
    assertThat( unmarshalledKey.getClass() ).isEqualTo( SerializableRowKey.class );
    assertThat( unmarshalledKey.getColumnNames() ).isEqualTo( key.getColumnNames() );
    assertThat( unmarshalledKey.getColumnValues() ).isEqualTo( key.getColumnValues() );

    assertTrue( key.equals( unmarshalledKey ) );
    assertTrue( unmarshalledKey.equals( key ) );
    assertThat( unmarshalledKey.hashCode() ).isEqualTo( key.hashCode() );
  }
View Full Code Here

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

    final Cache<SerializableAssociationKey> associationCache = datastoreProvider.getAssociationCache();
View Full Code Here

TOP

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

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.