com.gigaspaces.converter
Interface IPojoToEntryConverter

All Known Implementing Classes:
Pojo2ExternalEntryConverter

public interface IPojoToEntryConverter

An interface defining the functionality for a converter object, used
implicitly (by the GigaSpacesTemplate) or explicitly (by the application
developer) to convert Jini Entry objects to simple POJOs which do not
implement any interface or extend any class, and the other way. This
conversion is a part of the core capabilities of the GigaSpaces-Spring
integration package, and is offered to alleviate migration between existing
object stores/caches/ORMs to GigaSpaces without the hassle of changing all
domain objects to implement the Entry interface, as the Jini specification dictates


Method Summary
 void clean()
          Clean all the caching data from the converter
 IGSEntry toEntry(Object pojo)
          Transform the supplied POJO(Plain Old Java Object) into an IGSEntry implementation, according to some specific policy/implementation.
 IGSEntry toEntry(Object pojo, boolean isIgnoreGenerateAutoPK)
          Need to be use only if the POJO has declaration of primary key and auto generator and don't want to generate the primary key.
 Object toPojo(Entry entry)
          Transform the supplied Entry into aPOJO(Plain Old Java Object) according to some specific policy/implementation.
 Object toPojoFromIGSEntry(IGSEntry entry)
          Transform the supplied IGSEntry into aPOJO(Plain Old Java Object) according to some specific policy/implementation.
 

Method Detail

toEntry

IGSEntry toEntry(Object pojo)
Transform the supplied POJO(Plain Old Java Object) into an IGSEntry implementation, according to some specific policy/implementation.

Parameters:
pojo -
Returns:
the IGSEntry implementation

toEntry

IGSEntry toEntry(Object pojo,
                 boolean isIgnoreGenerateAutoPK)
Need to be use only if the POJO has declaration of primary key and auto generator and don't want to generate the primary key. Transform the supplied POJO(Plain Old Java Object) into an Entry implementation, according to some specific policy/implementation. The boolean isIgnoreGenerateAutoPK is indication if to generate primary key when at least one of the POJO field is declared as primary key and auto generated and has null value. When is true (isIgnoreGenerateAutoPK) and the field is primary key and auto generated and null value then it will not create new uid and the POJO field will be not update with new pk. If false(isIgnoreGenerateAutoPK), uid will be created when the there is a field as primary key and has null value and declared as auto generated. If using toEntry(Object pojo) method , the default is false.

Parameters:
pojo -
isIgnoreGenerateAutoPK - boolean indicate the POJO has declaration of primary key and auto generator and don't want to generate the primary key.
Returns:
the Entry implementation

toPojo

Object toPojo(Entry entry)
Transform the supplied Entry into aPOJO(Plain Old Java Object) according to some specific policy/implementation.

Parameters:
entry -
Returns:
the pojo

toPojoFromIGSEntry

Object toPojoFromIGSEntry(IGSEntry entry)
Transform the supplied IGSEntry into aPOJO(Plain Old Java Object) according to some specific policy/implementation.

Parameters:
entry - the IGSEntry
Returns:
the POJO

clean

void clean()
Clean all the caching data from the converter