Author: sannegrinovero
Date: 2008-05-29 10:43:52 -0400 (Thu, 29 May 2008)
New Revision: 14709
Modified:
search/trunk/src/java/org/hibernate/search/backend/AddLuceneWork.java
search/trunk/src/java/org/hibernate/search/backend/DeleteLuceneWork.java
search/trunk/src/java/org/hibernate/search/backend/LuceneWork.java
search/trunk/src/java/org/hibernate/search/backend/OptimizeLuceneWork.java
search/trunk/src/java/org/hibernate/search/backend/PurgeAllLuceneWork.java
Log:
LuceneWork implementations made Serializable, assigned UID.
Modified: search/trunk/src/java/org/hibernate/search/backend/AddLuceneWork.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/backend/AddLuceneWork.java 2008-05-29
11:56:45 UTC (rev 14708)
+++ search/trunk/src/java/org/hibernate/search/backend/AddLuceneWork.java 2008-05-29
14:43:52 UTC (rev 14709)
@@ -8,7 +8,10 @@
/**
* @author Emmanuel Bernard
*/
-public class AddLuceneWork extends LuceneWork {
+public class AddLuceneWork extends LuceneWork implements Serializable {
+
+ private static final long serialVersionUID = -2450349312813297371L;
+
public AddLuceneWork(Serializable id, String idInString, Class entity, Document
document) {
super( id, idInString, entity, document );
}
Modified: search/trunk/src/java/org/hibernate/search/backend/DeleteLuceneWork.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/backend/DeleteLuceneWork.java 2008-05-29
11:56:45 UTC (rev 14708)
+++ search/trunk/src/java/org/hibernate/search/backend/DeleteLuceneWork.java 2008-05-29
14:43:52 UTC (rev 14709)
@@ -6,7 +6,9 @@
/**
* @author Emmanuel Bernard
*/
-public class DeleteLuceneWork extends LuceneWork {
+public class DeleteLuceneWork extends LuceneWork implements Serializable {
+ private static final long serialVersionUID = -854604138119230246L;
+
public DeleteLuceneWork(Serializable id, String idInString, Class entity) {
super( id, idInString, entity );
}
Modified: search/trunk/src/java/org/hibernate/search/backend/LuceneWork.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/backend/LuceneWork.java 2008-05-29 11:56:45
UTC (rev 14708)
+++ search/trunk/src/java/org/hibernate/search/backend/LuceneWork.java 2008-05-29 14:43:52
UTC (rev 14709)
@@ -12,16 +12,16 @@
* @author Hardy Ferentschik
*/
public abstract class LuceneWork implements Serializable {
- //TODO set a serial id
- private Document document;
- private Class entityClass;
- private Serializable id;
+
+ private final Document document;
+ private final Class entityClass;
+ private final Serializable id;
/**
* Flag indicating if this lucene work has to be indexed in batch mode.
*/
private boolean batch = false;
- private String idInString;
+ private final String idInString;
public LuceneWork(Serializable id, String idInString, Class entity) {
this( id, idInString, entity, null );
@@ -38,6 +38,7 @@
return batch;
}
+ //TODO move to final field, or enable synchronization?
public void setBatch(boolean batch) {
this.batch = batch;
}
Modified: search/trunk/src/java/org/hibernate/search/backend/OptimizeLuceneWork.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/backend/OptimizeLuceneWork.java 2008-05-29
11:56:45 UTC (rev 14708)
+++ search/trunk/src/java/org/hibernate/search/backend/OptimizeLuceneWork.java 2008-05-29
14:43:52 UTC (rev 14709)
@@ -1,11 +1,13 @@
// $Id$
package org.hibernate.search.backend;
+import java.io.Serializable;
+
/**
* @author Andrew Hahn
* @author Emmanuel Bernard
*/
-public class OptimizeLuceneWork extends LuceneWork {
+public class OptimizeLuceneWork extends LuceneWork implements Serializable {
public OptimizeLuceneWork(Class entity) {
super( null, null, entity );
}
Modified: search/trunk/src/java/org/hibernate/search/backend/PurgeAllLuceneWork.java
===================================================================
--- search/trunk/src/java/org/hibernate/search/backend/PurgeAllLuceneWork.java 2008-05-29
11:56:45 UTC (rev 14708)
+++ search/trunk/src/java/org/hibernate/search/backend/PurgeAllLuceneWork.java 2008-05-29
14:43:52 UTC (rev 14709)
@@ -8,7 +8,9 @@
*
* @author John Griffin
*/
-public class PurgeAllLuceneWork extends LuceneWork {
+public class PurgeAllLuceneWork extends LuceneWork implements Serializable {
+ private static final long serialVersionUID = 8124091288284011715L;
+
public PurgeAllLuceneWork(Class entity) {
super( null, null, entity, null );
}