Spring Data Commons

org.springframework.data.repository.support
Class DomainClassPropertyEditorRegistrar

java.lang.Object
  extended by org.springframework.data.repository.support.DomainClassPropertyEditorRegistrar
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.PropertyEditorRegistrar, org.springframework.context.ApplicationContextAware

public class DomainClassPropertyEditorRegistrar
extends java.lang.Object
implements org.springframework.beans.PropertyEditorRegistrar, org.springframework.context.ApplicationContextAware

Simple helper class to use Hades DAOs to provide PropertyEditors for domain classes. To get this working configure a ConfigurableWebBindingInitializer for your org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter and register the DomainClassPropertyEditorRegistrar there: <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"> <property name="webBindingInitializer"> <bean class="org.springframework.web.bind.support.ConfigurableWebBindingInitializer"> <property name="propertyEditorRegistrars"> <bean class="org.springframework.data.extensions.beans.DomainClassPropertyEditorRegistrar" /> </property> </bean> </property> </bean> Make sure this bean declaration is in the ApplicationContext created by the DispatcherServlet whereas the repositories need to be declared in the root WebApplicationContext.

Author:
Oliver Gierke

Constructor Summary
DomainClassPropertyEditorRegistrar()
           
 
Method Summary
 void registerCustomEditors(org.springframework.beans.PropertyEditorRegistry registry)
           
 void setApplicationContext(org.springframework.context.ApplicationContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DomainClassPropertyEditorRegistrar

public DomainClassPropertyEditorRegistrar()
Method Detail

registerCustomEditors

public void registerCustomEditors(org.springframework.beans.PropertyEditorRegistry registry)
Specified by:
registerCustomEditors in interface org.springframework.beans.PropertyEditorRegistrar

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext context)
Specified by:
setApplicationContext in interface org.springframework.context.ApplicationContextAware

Spring Data Commons

Copyright © 2012. All Rights Reserved.