org.acegisecurity.domain.hibernate
Class IntrospectionManagerHibernate

java.lang.Object
  extended by org.acegisecurity.domain.hibernate.IntrospectionManagerHibernate
All Implemented Interfaces:
IntrospectionManager, InitializingBean

public class IntrospectionManagerHibernate
extends Object
implements IntrospectionManager, InitializingBean

IntrospectionManager that uses Hibernate metadata to locate children.

Add children objects are added to the List of children objects to validate, irrespective of whether a save/update/delete operation will cascade to them. This is not a perfect solution, but addresses most real-world validation requirements (you can always implement your own IntrospectionManager if you prefer).

This implementation only adds properties of a parent object that have a Hibernate net.sf.hibernate.type.Type that indicates it is an object type (ie net.sf.hibernate.type.Type#isObjectType()).

Author:
Matthew Porter, Ben Alex

Constructor Summary
IntrospectionManagerHibernate()
           
 
Method Summary
 void afterPropertiesSet()
           
 org.hibernate.SessionFactory[] getSessionFactories()
           
 ValidationRegistryManager getValidationRegistryManager()
           
 void obtainImmediateChildren(Object parentObject, List<Object> allObjects)
          Locates any direct children of a domain object.
 void setSessionFactories(org.hibernate.SessionFactory[] sessionFactorys)
           
 void setValidationRegistryManager(ValidationRegistryManager validationRegistryManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntrospectionManagerHibernate

public IntrospectionManagerHibernate()
Method Detail

setSessionFactories

public void setSessionFactories(org.hibernate.SessionFactory[] sessionFactorys)

getSessionFactories

public org.hibernate.SessionFactory[] getSessionFactories()

setValidationRegistryManager

public void setValidationRegistryManager(ValidationRegistryManager validationRegistryManager)

getValidationRegistryManager

public ValidationRegistryManager getValidationRegistryManager()

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

obtainImmediateChildren

public void obtainImmediateChildren(Object parentObject,
                                    List<Object> allObjects)
Description copied from interface: IntrospectionManager
Locates any direct children of a domain object.

Typically used with a ValidationManager to validate each of the located children.

Implementations should only add the immediate layer of children. Grandchildren, great-grandchildren etc should not be added.

Specified by:
obtainImmediateChildren in interface IntrospectionManager
Parameters:
parentObject - the immediate parent which all children should share (guaranteed to never be null)
allObjects - the list to which this method should append each immediate child (guaranteed to never be null)


Copyright © 2004-2005 Acegi Technology Pty Limited. All Rights Reserved.