Commits

Anonymous committed 36a9de2

Added an implementation of getPropertySet that defaults on the delegate

Comments (0)

Files changed (2)

src/java/com/opensymphony/workflow/spi/hibernate/AbstractHibernateWorkflowStore.java

 
     //~ Methods ////////////////////////////////////////////////////////////////
 
-    // ~ Abstract Methods ////////////////////////////////////////////////////////////////
-    public abstract PropertySet getPropertySet(long entryId) throws StoreException;
-
     // ~ Getter/Setter ////////////////////////////////////////////////////////////////
     public void setCacheRegion(String cacheRegion) {
         this.cacheRegion = cacheRegion;
         loadEntry(entryId).setState(state);
     }
 
+    public PropertySet getPropertySet(long entryId) throws StoreException {
+        if (getPropertySetDelegate() == null) {
+            throw new StoreException("PropertySetDelegate is not properly configured");
+        }
+
+        return getPropertySetDelegate().getPropertySet(entryId);
+    }
+
     public void setPropertySetDelegate(PropertySetDelegate propertySetDelegate) {
         this.propertySetDelegate = propertySetDelegate;
     }

src/java/com/opensymphony/workflow/spi/hibernate3/AbstractHibernateWorkflowStore.java

 public abstract class AbstractHibernateWorkflowStore implements WorkflowStore {
     //~ Instance fields ////////////////////////////////////////////////////////
 
-    // ~ Instance fields ////////////////////////////////////////////////////////
     private PropertySetDelegate propertySetDelegate;
     private String cacheRegion = null;
     private boolean cacheable = false;
 
     //~ Methods ////////////////////////////////////////////////////////////////
 
-    // ~ Abstract Methods ////////////////////////////////////////////////////////////////
-    public abstract PropertySet getPropertySet(long entryId) throws StoreException;
-
     // ~ Getter/Setter ////////////////////////////////////////////////////////////////
     public void setCacheRegion(String cacheRegion) {
         this.cacheRegion = cacheRegion;
         loadEntry(entryId).setState(state);
     }
 
+    public PropertySet getPropertySet(long entryId) throws StoreException {
+        if (getPropertySetDelegate() == null) {
+            throw new StoreException("PropertySetDelegate is not properly configured");
+        }
+
+        return getPropertySetDelegate().getPropertySet(entryId);
+    }
+
     public void setPropertySetDelegate(PropertySetDelegate propertySetDelegate) {
         this.propertySetDelegate = propertySetDelegate;
     }