Class LuceneIndexRepository
java.lang.Object
com.googlecode.luceneappengine.firestore.BaseFirestoreRepository<LuceneIndex>
com.googlecode.luceneappengine.model.repository.LuceneIndexRepository
A repository to manage CRUD on LuceneIndex.
-
Field Summary
Fields inherited from class com.googlecode.luceneappengine.firestore.BaseFirestoreRepository
clazz, collectionName, firestore, firestoreCollectionMapper
-
Constructor Summary
ConstructorsConstructorDescriptionLuceneIndexRepository
(com.google.cloud.firestore.Firestore firestore, FirestoreCollectionMapper datastoreEntityMapper) Create a Repository for LuceneIndex -
Method Summary
Modifier and TypeMethodDescriptionfindAll()
Returns the available indexs.com.google.cloud.firestore.DocumentReference
findRefById
(String id) Return the firestore document reference.getOrCreate
(String indexName) Return and index of a name.com.google.cloud.firestore.DocumentReference
saveIndex
(LuceneIndex entity) Save the index in the datastore.Methods inherited from class com.googlecode.luceneappengine.firestore.BaseFirestoreRepository
findAll, runInTransaction
-
Constructor Details
-
LuceneIndexRepository
public LuceneIndexRepository(com.google.cloud.firestore.Firestore firestore, FirestoreCollectionMapper datastoreEntityMapper) Create a Repository for LuceneIndex- Parameters:
firestore
- the firestoredatastoreEntityMapper
- the datastore entity mapper
-
-
Method Details
-
findRefById
Return the firestore document reference.- Parameters:
id
- the id of the codument in the current index- Returns:
- The firestore document reference
-
findAll
Returns the available indexs.- Returns:
- The indexes available
-
saveIndex
Save the index in the datastore.- Parameters:
entity
- The index to be saved- Returns:
- The document reference in firestore
-
getOrCreate
Return and index of a name.- Parameters:
indexName
- The name of the index- Returns:
- a specific index
-