com.hazelcast.spring.jpa
Class JPAMapStore

java.lang.Object
  extended by com.hazelcast.spring.jpa.JPAMapStore
All Implemented Interfaces:
MapLoader<Serializable,Object>, MapStore<Serializable,Object>

public class JPAMapStore
extends Object
implements MapStore<Serializable,Object>


Constructor Summary
JPAMapStore()
           
 
Method Summary
 void delete(Serializable key)
          Deletes the entry with a given key from the store.
 void deleteAll(Collection keys)
          Deletes multiple entries from the store.
 org.springframework.data.repository.CrudRepository getCrudRepository()
           
 Object load(Serializable key)
          Loads the value of a given key.
 Map loadAll(Collection collection)
          Loads given keys.
 Set loadAllKeys()
          Loads all of the keys from the store.
 void setCrudRepository(org.springframework.data.repository.CrudRepository crudRepository)
           
 void store(Serializable key, Object value)
          Stores the key-value pair.
 void storeAll(Map map)
          Stores multiple entries.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPAMapStore

public JPAMapStore()
Method Detail

getCrudRepository

public org.springframework.data.repository.CrudRepository getCrudRepository()

setCrudRepository

public void setCrudRepository(org.springframework.data.repository.CrudRepository crudRepository)

store

public void store(Serializable key,
                  Object value)
Description copied from interface: MapStore
Stores the key-value pair. If an exception is thrown then the put operation will fail.

Specified by:
store in interface MapStore<Serializable,Object>
Parameters:
key - key of the entry to store
value - value of the entry to store

storeAll

public void storeAll(Map map)
Description copied from interface: MapStore
Stores multiple entries. Implementation of this method can optimize the store operation by storing all entries in one database connection for instance. storeAll used when writeDelaySeconds is positive (write-behind). If an exception is thrown the entries will be tried to be stored one by one using store() method.

Specified by:
storeAll in interface MapStore<Serializable,Object>
Parameters:
map - map of entries to store

delete

public void delete(Serializable key)
Description copied from interface: MapStore
Deletes the entry with a given key from the store. If an exception is thrown the remove operation will fail.

Specified by:
delete in interface MapStore<Serializable,Object>
Parameters:
key - key to delete from the store.

load

public Object load(Serializable key)
Description copied from interface: MapLoader
Loads the value of a given key. If distributed map doesn't contain the value for the given key then Hazelcast will call implementation's load (key) method to obtain the value. Implementation can use any means of loading the given key; such as an O/R mapping tool, simple SQL or reading a file etc.

Specified by:
load in interface MapLoader<Serializable,Object>
Returns:
value of the key

deleteAll

public void deleteAll(Collection keys)
Description copied from interface: MapStore
Deletes multiple entries from the store. If an exception is thrown the entries will be tried to be deleted one by one using delete() method.

Specified by:
deleteAll in interface MapStore<Serializable,Object>
Parameters:
keys - keys of the entries to delete.

loadAll

public Map loadAll(Collection collection)
Description copied from interface: MapLoader
Loads given keys. This is batch load operation so that implementation can optimize the multiple loads.

Specified by:
loadAll in interface MapLoader<Serializable,Object>
Parameters:
collection - keys of the values entries to load
Returns:
map of loaded key-value pairs.

loadAllKeys

public Set loadAllKeys()
Description copied from interface: MapLoader
Loads all of the keys from the store.

Specified by:
loadAllKeys in interface MapLoader<Serializable,Object>
Returns:
all the keys


Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.