Spring Data Solr

org.springframework.data.solr.core.query
Class PartialUpdate

java.lang.Object
  extended by org.springframework.data.solr.core.query.PartialUpdate
All Implemented Interfaces:
Update

public class PartialUpdate
extends Object
implements Update

Implementation of Update to be used when performing atomic updates against solr.
Update can directly be saved via SolrOperations.saveBean(Object)

Author:
Christoph Strobl

Constructor Summary
PartialUpdate(Field idField, Object idFieldValue)
           
PartialUpdate(String idFieldName, Object idFieldValue)
           
 
Method Summary
 void add(String fieldName, Object value)
          Add field with given name and value to the fields to be updated.
 void add(UpdateField field)
          Add UpdateField to the list of fields to be updated
 void addValueToField(String fieldName, Object value)
          Add field with given name and value using UpateAction.ADD to the fields to be updated.
 ValueHoldingField getIdField()
          get id field of document to update
 List<UpdateField> getUpdates()
          List of fields and values to update
 Object getVersion()
          Document Version _version_
 void increaseValueOfField(String fieldName, Object value)
          Add field with given name and value using UpateAction.INC to the fields to be updated.
 void setValueOfField(String fieldName, Object value)
          Add field with given name and value using UpateAction.SET to the fields to be updated.
 void setVersion(Object documentVersion)
          set _version_ of document to apply update to.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartialUpdate

public PartialUpdate(String idFieldName,
                     Object idFieldValue)

PartialUpdate

public PartialUpdate(Field idField,
                     Object idFieldValue)
Method Detail

getIdField

public ValueHoldingField getIdField()
Description copied from interface: Update
get id field of document to update

Specified by:
getIdField in interface Update
Returns:

add

public void add(String fieldName,
                Object value)
Add field with given name and value to the fields to be updated. Default UpateAction will be UpateAction.SET.

Parameters:
fieldName -
value -

add

public void add(UpdateField field)
Add UpdateField to the list of fields to be updated

Parameters:
field -

addValueToField

public void addValueToField(String fieldName,
                            Object value)
Add field with given name and value using UpateAction.ADD to the fields to be updated.

Parameters:
fieldName -
value -

setValueOfField

public void setValueOfField(String fieldName,
                            Object value)
Add field with given name and value using UpateAction.SET to the fields to be updated.

Parameters:
fieldName -
value -

increaseValueOfField

public void increaseValueOfField(String fieldName,
                                 Object value)
Add field with given name and value using UpateAction.INC to the fields to be updated.

Parameters:
fieldName -
value -

getUpdates

public List<UpdateField> getUpdates()
Description copied from interface: Update
List of fields and values to update

Specified by:
getUpdates in interface Update
Returns:

getVersion

public Object getVersion()
Description copied from interface: Update
Document Version _version_

Specified by:
getVersion in interface Update
Returns:

setVersion

public void setVersion(Object documentVersion)
set _version_ of document to apply update to. Use null to skip version check in solr.

Parameters:
documentVersion -

Spring Data Solr

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