Lucene full text search aware session.
| Method from org.hibernate.search.impl.FullTextSessionImpl Detail: |
public void afterScrollOperation() {
sessionImplementor.afterScrollOperation();
}
|
public void afterTransactionCompletion(boolean successful,
Transaction tx) {
sessionImplementor.afterTransactionCompletion( successful, tx );
}
|
public void beforeTransactionCompletion(Transaction tx) {
sessionImplementor.beforeTransactionCompletion( tx );
}
|
public Transaction beginTransaction() throws HibernateException {
return session.beginTransaction();
}
|
public String bestGuessEntityName(Object object) {
return sessionImplementor.bestGuessEntityName( object );
}
|
public void cancelQuery() throws HibernateException {
session.cancelQuery();
}
|
public void clear() {
//FIXME should session clear work with the lucene queue
session.clear();
}
|
public Connection close() throws HibernateException {
return session.close();
}
|
public Connection connection() throws HibernateException {
return session.connection();
}
|
public boolean contains(Object object) {
return session.contains( object );
}
|
public Criteria createCriteria(String entityName) {
return session.createCriteria( entityName );
}
|
public Criteria createCriteria(Class persistentClass) {
return session.createCriteria( persistentClass );
}
|
public Criteria createCriteria(String entityName,
String alias) {
return session.createCriteria( entityName, alias );
}
|
public Criteria createCriteria(Class persistentClass,
String alias) {
return session.createCriteria( persistentClass, alias );
}
|
public Query createFilter(Object collection,
String queryString) throws HibernateException {
return session.createFilter( collection, queryString );
}
|
public FullTextQuery createFullTextQuery(Query luceneQuery,
Class entities) {
return new FullTextQueryImpl( luceneQuery, entities, sessionImplementor, new ParameterMetadata( null, null ) );
}
Execute a Lucene query and retrieve managed objects of type entities (or their indexed subclasses)
If entities is empty, include all indexed entities |
public Query createQuery(String queryString) throws HibernateException {
return session.createQuery( queryString );
}
|
public SQLQuery createSQLQuery(String queryString) throws HibernateException {
return session.createSQLQuery( queryString );
}
|
public Query createSQLQuery(String sql,
String returnAlias,
Class returnClass) {
return session.createSQLQuery( sql, returnAlias, returnClass );
}
|
public Query createSQLQuery(String sql,
String[] returnAliases,
Class[] returnClasses) {
return session.createSQLQuery( sql, returnAliases, returnClasses );
}
|
public int delete(String query) throws HibernateException {
return session.delete( query );
}
|
public void delete(Object object) throws HibernateException {
session.delete( object );
}
|
public void delete(String entityName,
Object object) throws HibernateException {
session.delete( entityName, object );
}
|
public int delete(String query,
Object value,
Type type) throws HibernateException {
return session.delete( query, value, type );
}
|
public int delete(String query,
Object[] values,
Type[] types) throws HibernateException {
return session.delete( query, values, types );
}
|
public void disableFilter(String filterName) {
session.disableFilter( filterName );
}
|
public Connection disconnect() throws HibernateException {
return session.disconnect();
}
|
public void doWork(Work work) throws HibernateException {
session.doWork( work );
}
|
public Filter enableFilter(String filterName) {
return session.enableFilter( filterName );
}
|
public void evict(Object object) throws HibernateException {
session.evict( object );
}
|
public int executeNativeUpdate(NativeSQLQuerySpecification specification,
QueryParameters queryParameters) throws HibernateException {
return sessionImplementor.executeNativeUpdate( specification, queryParameters );
}
|
public int executeUpdate(String query,
QueryParameters queryParameters) throws HibernateException {
return sessionImplementor.executeUpdate( query, queryParameters );
}
|
public Collection filter(Object collection,
String filter) throws HibernateException {
return session.filter( collection, filter );
}
|
public Collection filter(Object collection,
String filter,
Object value,
Type type) throws HibernateException {
return session.filter( collection, filter, value, type );
}
|
public Collection filter(Object collection,
String filter,
Object[] values,
Type[] types) throws HibernateException {
return session.filter( collection, filter, values, types );
}
|
public List find(String query) throws HibernateException {
return session.find( query );
}
|
public List find(String query,
Object value,
Type type) throws HibernateException {
return session.find( query, value, type );
}
|
public List find(String query,
Object[] values,
Type[] types) throws HibernateException {
return session.find( query, values, types );
}
|
public void flush() throws HibernateException {
session.flush();
}
|
public void flushToIndexes() {
SearchFactoryImplementor searchFactoryImplementor = getSearchFactoryImplementor();
searchFactoryImplementor.getWorker().flushWorks( transactionContext );
}
|
public Object get(Class clazz,
Serializable id) throws HibernateException {
return session.get( clazz, id );
}
|
public Object get(String entityName,
Serializable id) throws HibernateException {
return session.get( entityName, id );
}
|
public Object get(Class clazz,
Serializable id,
LockMode lockMode) throws HibernateException {
return session.get( clazz, id, lockMode );
}
|
public Object get(String entityName,
Serializable id,
LockMode lockMode) throws HibernateException {
return session.get( entityName, id, lockMode );
}
|
public Batcher getBatcher() {
return sessionImplementor.getBatcher();
}
|
public CacheMode getCacheMode() {
return session.getCacheMode();
}
|
public Serializable getContextEntityIdentifier(Object object) {
return sessionImplementor.getContextEntityIdentifier( object );
}
|
public LockMode getCurrentLockMode(Object object) throws HibernateException {
return session.getCurrentLockMode( object );
}
|
public int getDontFlushFromFind() {
return sessionImplementor.getDontFlushFromFind();
}
|
public Filter getEnabledFilter(String filterName) {
return session.getEnabledFilter( filterName );
}
|
public Map getEnabledFilters() {
return sessionImplementor.getEnabledFilters();
}
|
public EntityMode getEntityMode() {
return session.getEntityMode();
}
|
public String getEntityName(Object object) throws HibernateException {
return session.getEntityName( object );
}
|
public EntityPersister getEntityPersister(String entityName,
Object object) throws HibernateException {
return sessionImplementor.getEntityPersister( entityName, object );
}
|
public Object getEntityUsingInterceptor(EntityKey key) throws HibernateException {
return sessionImplementor.getEntityUsingInterceptor( key );
}
|
public SessionFactoryImplementor getFactory() {
return sessionImplementor.getFactory();
}
|
public String getFetchProfile() {
return sessionImplementor.getFetchProfile();
}
|
public Type getFilterParameterType(String filterParameterName) {
return sessionImplementor.getFilterParameterType( filterParameterName );
}
|
public Object getFilterParameterValue(String filterParameterName) {
return sessionImplementor.getFilterParameterValue( filterParameterName );
}
|
public FlushMode getFlushMode() {
return session.getFlushMode();
}
|
public Serializable getIdentifier(Object object) throws HibernateException {
return session.getIdentifier( object );
}
|
public Interceptor getInterceptor() {
return sessionImplementor.getInterceptor();
}
|
public JDBCContext getJDBCContext() {
return sessionImplementor.getJDBCContext();
}
|
public EventListeners getListeners() {
return sessionImplementor.getListeners();
}
|
public Query getNamedQuery(String queryName) throws HibernateException {
return session.getNamedQuery( queryName );
}
|
public Query getNamedSQLQuery(String name) {
return sessionImplementor.getNamedSQLQuery( name );
}
|
public PersistenceContext getPersistenceContext() {
return sessionImplementor.getPersistenceContext();
}
|
public SearchFactory getSearchFactory() {
if ( searchFactory == null ) {
searchFactory = ContextHelper.getSearchFactory( session );
}
return searchFactory;
}
|
public Session getSession(EntityMode entityMode) {
return session.getSession( entityMode );
}
|
public SessionFactory getSessionFactory() {
return session.getSessionFactory();
}
|
public SessionStatistics getStatistics() {
return session.getStatistics();
}
|
public long getTimestamp() {
return sessionImplementor.getTimestamp();
}
|
public Transaction getTransaction() {
return session.getTransaction();
}
|
public String guessEntityName(Object entity) throws HibernateException {
return sessionImplementor.guessEntityName( entity );
}
|
public Object immediateLoad(String entityName,
Serializable id) throws HibernateException {
return sessionImplementor.immediateLoad( entityName, id );
}
|
public void index(Object entity) {
if ( entity == null ) {
throw new IllegalArgumentException( "Entity to index should not be null" );
}
Class< ? > clazz = Hibernate.getClass( entity );
//TODO cache that at the FTSession level
SearchFactoryImplementor searchFactoryImplementor = getSearchFactoryImplementor();
//not strictly necessary but a small optimization
if ( searchFactoryImplementor.getDocumentBuilder( clazz ) == null ) {
String msg = "Entity to index is not an @Indexed entity: " + entity.getClass().getName();
throw new IllegalArgumentException( msg );
}
Serializable id = session.getIdentifier( entity );
Work work = new Work( entity, id, WorkType.INDEX );
searchFactoryImplementor.getWorker().performWork( work, transactionContext );
//TODO
//need to add elements in a queue kept at the Session level
//the queue will be processed by a Lucene(Auto)FlushEventListener
//note that we could keep this queue somewhere in the event listener in the mean time but that requires
//a synchronized hashmap holding this queue on a per session basis plus some session house keeping (yuk)
//another solution would be to subclass SessionImpl instead of having this LuceneSession delegation model
//this is an open discussion
}
(re)index an entity.
Non indexable entities are ignored
The entity must be associated with the session |
public void initializeCollection(PersistentCollection collection,
boolean writing) throws HibernateException {
sessionImplementor.initializeCollection( collection, writing );
}
|
public Object instantiate(String entityName,
Serializable id) throws HibernateException {
return sessionImplementor.instantiate( entityName, id );
}
|
public Object internalLoad(String entityName,
Serializable id,
boolean eager,
boolean nullable) throws HibernateException {
return sessionImplementor.internalLoad( entityName, id, eager, nullable );
}
|
public boolean isClosed() {
return sessionImplementor.isClosed();
}
|
public boolean isConnected() {
return session.isConnected();
}
|
public boolean isDirty() throws HibernateException {
return session.isDirty();
}
|
public boolean isEventSource() {
return sessionImplementor.isEventSource();
}
|
public boolean isOpen() {
return session.isOpen();
}
|
public boolean isTransactionInProgress() {
return sessionImplementor.isTransactionInProgress();
}
|
public Iterator iterate(String query) throws HibernateException {
return session.iterate( query );
}
|
public Iterator iterate(String query,
QueryParameters queryParameters) throws HibernateException {
return sessionImplementor.iterate( query, queryParameters );
}
|
public Iterator iterate(String query,
Object value,
Type type) throws HibernateException {
return session.iterate( query, value, type );
}
|
public Iterator iterate(String query,
Object[] values,
Type[] types) throws HibernateException {
return session.iterate( query, values, types );
}
|
public Iterator iterateFilter(Object collection,
String filter,
QueryParameters queryParameters) throws HibernateException {
return sessionImplementor.iterateFilter( collection, filter, queryParameters );
}
|
public List list(CriteriaImpl criteria) {
return sessionImplementor.list( criteria );
}
|
public List list(String query,
QueryParameters queryParameters) throws HibernateException {
return sessionImplementor.list( query, queryParameters );
}
|
public List list(NativeSQLQuerySpecification spec,
QueryParameters queryParameters) throws HibernateException {
return sessionImplementor.list( spec, queryParameters );
}
|
public List listCustomQuery(CustomQuery customQuery,
QueryParameters queryParameters) throws HibernateException {
return sessionImplementor.listCustomQuery( customQuery, queryParameters );
}
|
public List listFilter(Object collection,
String filter,
QueryParameters queryParameters) throws HibernateException {
return sessionImplementor.listFilter( collection, filter, queryParameters );
}
|
public Object load(String entityName,
Serializable id) throws HibernateException {
return session.load( entityName, id );
}
|
public void load(Object object,
Serializable id) throws HibernateException {
session.load( object, id );
}
|
public Object load(Class theClass,
Serializable id) throws HibernateException {
return session.load( theClass, id );
}
|
public Object load(String entityName,
Serializable id,
LockMode lockMode) throws HibernateException {
return session.load( entityName, id, lockMode );
}
|
public Object load(Class theClass,
Serializable id,
LockMode lockMode) throws HibernateException {
return session.load( theClass, id, lockMode );
}
|
public void lock(Object object,
LockMode lockMode) throws HibernateException {
session.lock( object, lockMode );
}
|
public void lock(String entityName,
Object object,
LockMode lockMode) throws HibernateException {
session.lock( entityName, object, lockMode );
}
|
public Object merge(Object object) throws HibernateException {
return session.merge( object );
}
|
public Object merge(String entityName,
Object object) throws HibernateException {
return session.merge( entityName, object );
}
|
public void persist(Object object) throws HibernateException {
session.persist( object );
}
|
public void persist(String entityName,
Object object) throws HibernateException {
session.persist( entityName, object );
}
|
public void purge(Class entityType,
Serializable id) {
if ( entityType == null ) {
return;
}
// accessing the document builders is not strictly necessary but a small optimization plus let's make sure the
// client didn't mess something up.
SearchFactoryImplementor searchFactoryImplementor = getSearchFactoryImplementor();
DocumentBuilder builder = searchFactoryImplementor.getDocumentBuilder( entityType );
if ( builder == null ) {
String msg = "Entity to index is not an @Indexed entity: " + entityType.getName();
throw new IllegalArgumentException( msg );
}
Work work;
if ( id == null ) {
// purge the main entity
work = new Work( entityType, id, WorkType.PURGE_ALL );
searchFactoryImplementor.getWorker().performWork( work, transactionContext );
// purge the subclasses
Set< Class< ? > > subClasses = builder.getMappedSubclasses();
for ( Class clazz : subClasses ) {
work = new Work( clazz, id, WorkType.PURGE_ALL );
searchFactoryImplementor.getWorker().performWork( work, transactionContext );
}
}
else {
work = new Work( entityType, id, WorkType.PURGE );
searchFactoryImplementor.getWorker().performWork( work, transactionContext );
}
}
|
public void purgeAll(Class entityType) {
purge( entityType, null );
}
|
public void reconnect() throws HibernateException {
session.reconnect();
}
|
public void reconnect(Connection connection) throws HibernateException {
session.reconnect( connection );
}
|
public void refresh(Object object) throws HibernateException {
session.refresh( object );
}
|
public void refresh(Object object,
LockMode lockMode) throws HibernateException {
session.refresh( object, lockMode );
}
|
public void replicate(Object object,
ReplicationMode replicationMode) throws HibernateException {
session.replicate( object, replicationMode );
}
|
public void replicate(String entityName,
Object object,
ReplicationMode replicationMode) throws HibernateException {
session.replicate( entityName, object, replicationMode );
}
|
public Serializable save(Object object) throws HibernateException {
return session.save( object );
}
|
public void save(Object object,
Serializable id) throws HibernateException {
session.save( object, id );
}
|
public Serializable save(String entityName,
Object object) throws HibernateException {
return session.save( entityName, object );
}
|
public void save(String entityName,
Object object,
Serializable id) throws HibernateException {
session.save( entityName, object, id );
}
|
public void saveOrUpdate(Object object) throws HibernateException {
session.saveOrUpdate( object );
}
|
public void saveOrUpdate(String entityName,
Object object) throws HibernateException {
session.saveOrUpdate( entityName, object );
}
|
public Object saveOrUpdateCopy(Object object) throws HibernateException {
return session.saveOrUpdateCopy( object );
}
|
public Object saveOrUpdateCopy(String entityName,
Object object) throws HibernateException {
return session.saveOrUpdateCopy( entityName, object );
}
|
public Object saveOrUpdateCopy(Object object,
Serializable id) throws HibernateException {
return session.saveOrUpdateCopy( object, id );
}
|
public Object saveOrUpdateCopy(String entityName,
Object object,
Serializable id) throws HibernateException {
return session.saveOrUpdateCopy( entityName, object, id );
}
|
public ScrollableResults scroll(String query,
QueryParameters queryParameters) throws HibernateException {
return sessionImplementor.scroll( query, queryParameters );
}
|
public ScrollableResults scroll(CriteriaImpl criteria,
ScrollMode scrollMode) {
return sessionImplementor.scroll( criteria, scrollMode );
}
|
public ScrollableResults scroll(NativeSQLQuerySpecification spec,
QueryParameters queryParameters) throws HibernateException {
return sessionImplementor.scroll( spec, queryParameters );
}
|
public ScrollableResults scrollCustomQuery(CustomQuery customQuery,
QueryParameters queryParameters) throws HibernateException {
return sessionImplementor.scrollCustomQuery( customQuery, queryParameters );
}
|
public void setAutoClear(boolean enabled) {
sessionImplementor.setAutoClear( enabled );
}
|
public void setCacheMode(CacheMode cacheMode) {
session.setCacheMode( cacheMode );
}
|
public void setFetchProfile(String name) {
sessionImplementor.setFetchProfile( name );
}
|
public void setFlushMode(FlushMode flushMode) {
session.setFlushMode( flushMode );
}
|
public void setReadOnly(Object entity,
boolean readOnly) {
session.setReadOnly( entity, readOnly );
}
|
public void update(Object object) throws HibernateException {
session.update( object );
}
|
public void update(Object object,
Serializable id) throws HibernateException {
session.update( object, id );
}
|
public void update(String entityName,
Object object) throws HibernateException {
session.update( entityName, object );
}
|
public void update(String entityName,
Object object,
Serializable id) throws HibernateException {
session.update( entityName, object, id );
}
|