org.compass.gps.device.hibernate.entities
Class DefaultHibernateEntitiesLocator
java.lang.Object
org.compass.gps.device.hibernate.entities.DefaultHibernateEntitiesLocator
- All Implemented Interfaces:
- HibernateEntitiesLocator
public class DefaultHibernateEntitiesLocator
- extends Object
- implements HibernateEntitiesLocator
A default implemenation that automatically locates entities to index based
on Hibernate current mapped objects and mappings for the objects that exists
with Compass.
- Author:
- kimchy
|
Field Summary |
protected org.apache.commons.logging.Log |
log
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected org.apache.commons.logging.Log log
DefaultHibernateEntitiesLocator
public DefaultHibernateEntitiesLocator()
locate
public EntityInformation[] locate(SessionFactory sessionFactory,
HibernateGpsDevice device)
throws HibernateGpsDeviceException
- Description copied from interface:
HibernateEntitiesLocator
- Locates the entities used for the index operation.
- Specified by:
locate in interface HibernateEntitiesLocator
- Parameters:
sessionFactory - The SessionFactory to be optionally used for locating the entities.device - The Hibernate device that called this locator.
- Returns:
- An array of the enteties that need to be indexed during the index operation.
- Throws:
HibernateGpsDeviceException
shouldFilter
protected boolean shouldFilter(String entityname,
ClassMetadata classMetadata,
Map allClassMetaData,
HibernateGpsDevice device)
- Returns
true if the entity name needs to be filtered.
Implementation filteres out inherited hibernate mappings, since the select query
for the base class will cover any inherited classes as well.
Note, that this method is called after it has been verified that the class has
Compass mappings (either directly, or indirectly by an interface or a super class).
- Parameters:
entityname - The name of the entityclassMetadata - The Hibernate class meta data.device - The Hibernate Gps device
- Returns:
true if the entity should be filtered out, false if not.
Copyright (c) 2004-2008 The Compass Project.