Java Doc for HibernateGpsDevice.java in  » Search-Engine » compass-2.0 » org » compass » gps » device » hibernate » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Search Engine » compass 2.0 » org.compass.gps.device.hibernate 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.compass.gps.device.support.parallel.AbstractParallelGpsDevice
   org.compass.gps.device.hibernate.HibernateGpsDevice

HibernateGpsDevice
public class HibernateGpsDevice extends AbstractParallelGpsDevice implements PassiveMirrorGpsDevice(Code)

A Hibernate Gps Device.

The hibernate device provides support for using jpa to index a database. The path can be viewed as: Database <-> Hibernate <-> Objects <-> Compass::Gps <-> Compass::Core (Search Engine). What it means is that for every object that has both Hibernate and compass mappings, you will be able to index it's data, as well as real time mirroring of data changes.

When creating the object, a SessionFactory must be provided to the Device.

Indexing uses HibernateEntitiesLocator to locate all the entities that can be indexed (i.e. entities that have both Compass and Hibernate mappings). The default implementaion used it the org.compass.gps.device.hibernate.entities.DefaultHibernateEntitiesLocator .

The indexing process itself is done through an implementation of HibernateIndexEntitiesIndexer . It has two different implementation, the org.compass.gps.device.hibernate.indexer.PaginationHibernateIndexEntitiesIndexer and the org.compass.gps.device.hibernate.indexer.ScrollableHibernateIndexEntitiesIndexer . The default used is the scrollable indexer.

Mirroring is done by injecting lifecycle listeners into Hibernate. It is done using org.compass.gps.device.hibernate.lifecycle.HibernateEntityLifecycleInjector with a default implementation of org.compass.gps.device.hibernate.lifecycle.DefaultHibernateEntityLifecycleInjector .

Mirroring can be turned off using the HibernateGpsDevice.setMirrorDataChanges(boolean) to false. It defaults to true.

The device allows for org.compass.gps.device.hibernate.NativeHibernateExtractor to be set, for applications that use a framework or by themself wrap the actual SessionFactory implementation.

The device extends the parallel device provinding supprot for parallel indexing.
author:
   kimchy




Constructor Summary
public  HibernateGpsDevice()
    
public  HibernateGpsDevice(String name, SessionFactory sessionFactory)
    

Method Summary
protected  IndexEntity[]doGetIndexEntities()
    
protected  IndexEntitiesIndexerdoGetIndexEntitiesIndexer()
    
protected  voiddoStart()
    
protected  voiddoStop()
    
public  intgetFetchCount()
     Returns the fetch count for the indexing process.
public  HibernateMirrorFiltergetMirrorFilter()
     Returns mirroring filter that can filter hibernate mirror events.
public  SessionFactorygetSessionFactory()
     Returns a native Hibernate extractor to work with frameworks that wrap the actual SessionFactory.
public  booleanisIgnoreMirrorExceptions()
     Should exceptions be ignored during the mirroring operations (the Hibernate event listeners).
public  booleanisMirrorDataChanges()
    
public  voidsetEntitiesIndexer(HibernateIndexEntitiesIndexer entitiesIndexer)
     Sets a custom entities indexer allowing to control the indexing process.
public  voidsetEntitiesLocator(HibernateEntitiesLocator entitiesLocator)
     Sets a pluggable index entities locator allowing to control the indexes entties that will be used.
public  voidsetFetchCount(int fetchCount)
     Sets the fetch count for the indexing process.
public  voidsetIgnoreMirrorExceptions(boolean ignoreMirrorExceptions)
     Should exceptions be ignored during the mirroring operations (the Hibernate event listeners).
public  voidsetIndexQueryProvider(Class entityClass, HibernateQueryProvider queryProvider)
     Sets a specific query provider for the index process of the given entity class.
public  voidsetIndexQueryProvider(String entityName, HibernateQueryProvider queryProvider)
     Sets a specific query provider for the index process of the given entity name.
public  voidsetIndexSelectQuery(Class entityClass, String selectQuery)
    

Sets a specific select statement for the index process of the given entity class.

public  voidsetIndexSelectQuery(String entityName, String selectQuery)
     Sets a specific select statement for the index process of the given entity name.
public  voidsetLifecycleInjector(HibernateEntityLifecycleInjector lifecycleInjector)
     Sets a custom lifecycle injector controlling the injection of Hibernate lifecycle listeners for mirroring operations.
public  voidsetMirrorDataChanges(boolean mirrorDataChanges)
    
public  voidsetMirrorFilter(HibernateMirrorFilter mirrorFilter)
     Sets a mirroring filter that can filter hibernate mirror events.
public  voidsetNativeExtractor(NativeHibernateExtractor nativeExtractor)
     Sets a native Hibernate extractor to work with frameworks that wrap the actual SessionFactory.
public  voidsetSessionFactory(SessionFactory sessionFactory)
     Sets the Hibernate SessionFactory to be used before the start operation.


Constructor Detail
HibernateGpsDevice
public HibernateGpsDevice()(Code)



HibernateGpsDevice
public HibernateGpsDevice(String name, SessionFactory sessionFactory)(Code)




Method Detail
doGetIndexEntities
protected IndexEntity[] doGetIndexEntities() throws CompassGpsException(Code)



doGetIndexEntitiesIndexer
protected IndexEntitiesIndexer doGetIndexEntitiesIndexer()(Code)



doStart
protected void doStart() throws CompassGpsException(Code)



doStop
protected void doStop() throws CompassGpsException(Code)



getFetchCount
public int getFetchCount()(Code)
Returns the fetch count for the indexing process. A large number will perform the indexing faster, but will consume more memory. Default to 200.



getMirrorFilter
public HibernateMirrorFilter getMirrorFilter()(Code)
Returns mirroring filter that can filter hibernate mirror events. If no mirror filter is set no filtering will happen.



getSessionFactory
public SessionFactory getSessionFactory()(Code)
Returns a native Hibernate extractor to work with frameworks that wrap the actual SessionFactory.



isIgnoreMirrorExceptions
public boolean isIgnoreMirrorExceptions()(Code)
Should exceptions be ignored during the mirroring operations (the Hibernate event listeners). Defaults to false.



isMirrorDataChanges
public boolean isMirrorDataChanges()(Code)

See Also:   org.compass.gps.MirrorDataChangesGpsDevice.isMirrorDataChanges



setEntitiesIndexer
public void setEntitiesIndexer(HibernateIndexEntitiesIndexer entitiesIndexer)(Code)
Sets a custom entities indexer allowing to control the indexing process. Defaults to org.compass.gps.device.hibernate.indexer.PaginationHibernateIndexEntitiesIndexer .



setEntitiesLocator
public void setEntitiesLocator(HibernateEntitiesLocator entitiesLocator)(Code)
Sets a pluggable index entities locator allowing to control the indexes entties that will be used. Defaults to org.compass.gps.device.hibernate.entities.DefaultHibernateEntitiesLocator .



setFetchCount
public void setFetchCount(int fetchCount)(Code)
Sets the fetch count for the indexing process. A large number will perform the indexing faster, but will consume more memory. Defaults to 200.



setIgnoreMirrorExceptions
public void setIgnoreMirrorExceptions(boolean ignoreMirrorExceptions)(Code)
Should exceptions be ignored during the mirroring operations (the Hibernate event listeners). Defaults to false.



setIndexQueryProvider
public void setIndexQueryProvider(Class entityClass, HibernateQueryProvider queryProvider)(Code)
Sets a specific query provider for the index process of the given entity class.

Note, this information is used when the device starts.
Parameters:
  entityClass - The Entity class to associate the query provider with
Parameters:
  queryProvider - The query provider to execute when indexing the given entity




setIndexQueryProvider
public void setIndexQueryProvider(String entityName, HibernateQueryProvider queryProvider)(Code)
Sets a specific query provider for the index process of the given entity name.

Note, this information is used when the device starts.
Parameters:
  entityName - The Entity name to associate the query provider with
Parameters:
  queryProvider - The query provider to execute when indexing the given entity




setIndexSelectQuery
public void setIndexSelectQuery(Class entityClass, String selectQuery)(Code)

Sets a specific select statement for the index process of the given entity class.

Note, when using org.compass.gps.device.hibernate.indexer.ScrollableHibernateIndexEntitiesIndexer it is preferable not to use this mehotd, instead use HibernateGpsDevice.setIndexQueryProvider(Class,HibernateQueryProvider) and return a Hibernate Criteria object instead.

Note, this information is used when the device starts.
Parameters:
  entityClass - The Entity class to associate the select query with
Parameters:
  selectQuery - The select query to execute when indexing the given entity




setIndexSelectQuery
public void setIndexSelectQuery(String entityName, String selectQuery)(Code)
Sets a specific select statement for the index process of the given entity name.

Note, when using org.compass.gps.device.hibernate.indexer.ScrollableHibernateIndexEntitiesIndexer it is preferable not to use this mehotd, instead use HibernateGpsDevice.setIndexQueryProvider(String,HibernateQueryProvider) and return a Hibernate Criteria object instead.

Note, this information is used when the device starts.
Parameters:
  entityName - The entity name to associate the select query with
Parameters:
  selectQuery - The select query to execute when indexing the given entity




setLifecycleInjector
public void setLifecycleInjector(HibernateEntityLifecycleInjector lifecycleInjector)(Code)
Sets a custom lifecycle injector controlling the injection of Hibernate lifecycle listeners for mirroring operations. Defaults to org.compass.gps.device.hibernate.lifecycle.DefaultHibernateEntityLifecycleInjector .



setMirrorDataChanges
public void setMirrorDataChanges(boolean mirrorDataChanges)(Code)

See Also:   org.compass.gps.MirrorDataChangesGpsDevice.setMirrorDataChanges(boolean)



setMirrorFilter
public void setMirrorFilter(HibernateMirrorFilter mirrorFilter)(Code)
Sets a mirroring filter that can filter hibernate mirror events. If no mirror filter is set no filtering will happen.
Parameters:
  mirrorFilter - The mirror filter handler



setNativeExtractor
public void setNativeExtractor(NativeHibernateExtractor nativeExtractor)(Code)
Sets a native Hibernate extractor to work with frameworks that wrap the actual SessionFactory.



setSessionFactory
public void setSessionFactory(SessionFactory sessionFactory)(Code)
Sets the Hibernate SessionFactory to be used before the start operation.



Methods inherited from org.compass.gps.device.support.parallel.AbstractParallelGpsDevice
abstract protected IndexEntity[] doGetIndexEntities() throws CompassGpsException(Code)(Java Doc)
abstract protected IndexEntitiesIndexer doGetIndexEntitiesIndexer()(Code)(Java Doc)
final protected void doIndex(CompassSession session) throws CompassGpsException(Code)(Java Doc)
public synchronized void index() throws CompassGpsException(Code)(Java Doc)
public void setIndexEntitiesPartitioner(IndexEntitiesPartitioner indexEntitiesPartitioner)(Code)(Java Doc)
public void setParallelIndexExecutor(ParallelIndexExecutor parallelIndexExecutor)(Code)(Java Doc)
public synchronized void start() throws CompassGpsException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.