Spring Data Core

org.springframework.data.mapping.context
Class MappingContextIsNewStrategyFactory

java.lang.Object
  extended by org.springframework.data.support.IsNewStrategyFactorySupport
      extended by org.springframework.data.mapping.context.MappingContextIsNewStrategyFactory
All Implemented Interfaces:
IsNewStrategyFactory

public class MappingContextIsNewStrategyFactory
extends IsNewStrategyFactorySupport

An IsNewStrategyFactory using a MappingContext to determine the IsNewStrategy to be returned for a particular type. It will look for a version and id property on the PersistentEntity and return a strategy instance that will refelctively inspect the property for null values or null or a value of 0 in case of a version property.

Author:
Oliver Gierke

Constructor Summary
MappingContextIsNewStrategyFactory(MappingContext<? extends PersistentEntity<?,?>,?> context)
          Creates a new MappingContextIsNewStrategyFactory using the given MappingContext.
 
Method Summary
protected  IsNewStrategy doGetIsNewStrategy(Class<?> type)
          Determine the actual IsNewStrategy to be used for the given type.
 
Methods inherited from class org.springframework.data.support.IsNewStrategyFactorySupport
getIsNewStrategy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MappingContextIsNewStrategyFactory

public MappingContextIsNewStrategyFactory(MappingContext<? extends PersistentEntity<?,?>,?> context)
Creates a new MappingContextIsNewStrategyFactory using the given MappingContext.

Parameters:
context - must not be null.
Method Detail

doGetIsNewStrategy

protected IsNewStrategy doGetIsNewStrategy(Class<?> type)
Description copied from class: IsNewStrategyFactorySupport
Determine the actual IsNewStrategy to be used for the given type.

Specified by:
doGetIsNewStrategy in class IsNewStrategyFactorySupport
Parameters:
type - will never be null.
Returns:
the IsNewStrategy to be used for the given type or null in case none can be resolved.

Spring Data Core

Copyright © 2011-2013-2013 Pivotal. All Rights Reserved.