Coverage Report - org.kuali.rice.kns.service.impl.PersistenceServiceOjbImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
PersistenceServiceOjbImpl
0%
0/208
0%
0/108
7.571
 
 1  
 /*
 2  
  * Copyright 2005-2008 The Kuali Foundation
 3  
  * 
 4  
  * Licensed under the Educational Community License, Version 2.0 (the "License");
 5  
  * you may not use this file except in compliance with the License.
 6  
  * You may obtain a copy of the License at
 7  
  * 
 8  
  * http://www.opensource.org/licenses/ecl2.php
 9  
  * 
 10  
  * Unless required by applicable law or agreed to in writing, software
 11  
  * distributed under the License is distributed on an "AS IS" BASIS,
 12  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 13  
  * See the License for the specific language governing permissions and
 14  
  * limitations under the License.
 15  
  */
 16  
 package org.kuali.rice.kns.service.impl;
 17  
 
 18  
 import java.beans.PropertyDescriptor;
 19  
 import java.io.IOException;
 20  
 import java.io.InputStream;
 21  
 import java.lang.reflect.InvocationTargetException;
 22  
 import java.util.HashMap;
 23  
 import java.util.HashSet;
 24  
 import java.util.Iterator;
 25  
 import java.util.List;
 26  
 import java.util.Map;
 27  
 import java.util.Set;
 28  
 import java.util.Vector;
 29  
 
 30  
 import org.apache.commons.beanutils.PropertyUtils;
 31  
 import org.apache.commons.lang.StringUtils;
 32  
 import org.apache.log4j.Logger;
 33  
 import org.apache.ojb.broker.metadata.ClassDescriptor;
 34  
 import org.apache.ojb.broker.metadata.ConnectionRepository;
 35  
 import org.apache.ojb.broker.metadata.DescriptorRepository;
 36  
 import org.apache.ojb.broker.metadata.FieldDescriptor;
 37  
 import org.apache.ojb.broker.metadata.MetadataManager;
 38  
 import org.apache.ojb.broker.metadata.ObjectReferenceDescriptor;
 39  
 import org.apache.ojb.broker.metadata.fieldaccess.PersistentField;
 40  
 import org.kuali.rice.core.exception.RiceRuntimeException;
 41  
 import org.kuali.rice.core.util.ClassLoaderUtils;
 42  
 import org.kuali.rice.kns.bo.PersistableBusinessObject;
 43  
 import org.kuali.rice.kns.dao.PersistenceDao;
 44  
 import org.kuali.rice.kns.exception.IntrospectionException;
 45  
 import org.kuali.rice.kns.exception.ObjectNotABusinessObjectRuntimeException;
 46  
 import org.kuali.rice.kns.exception.ReferenceAttributeDoesntExistException;
 47  
 import org.kuali.rice.kns.exception.ReferenceAttributeNotAnOjbReferenceException;
 48  
 import org.kuali.rice.kns.service.KualiModuleService;
 49  
 import org.kuali.rice.kns.service.PersistenceService;
 50  
 import org.kuali.rice.kns.util.ObjectUtils;
 51  
 import org.springframework.core.io.DefaultResourceLoader;
 52  
 import org.springframework.transaction.annotation.Transactional;
 53  
 
 54  
 /**
 55  
  * This class is the service implementation for the Persistence structure.
 56  
  * OjbRepositoryExplorer provides functions for extracting information from the
 57  
  * OJB repository at runtime. This is the default implementation, that is
 58  
  * delivered with Kuali.
 59  
  */
 60  
 @Transactional
 61  0
 public class PersistenceServiceOjbImpl extends PersistenceServiceImplBase implements PersistenceService {
 62  0
     private static Logger LOG = Logger.getLogger(PersistenceServiceOjbImpl.class);
 63  
     private static final String CLASSPATH_RESOURCE_PREFIX = "classpath:";
 64  
     private PersistenceDao persistenceDao;
 65  
     
 66  
     public void clearCache() {
 67  0
         persistenceDao.clearCache();
 68  0
     }
 69  
     
 70  
     public Object resolveProxy(Object o) {
 71  0
         return persistenceDao.resolveProxy(o);
 72  
     }
 73  
 
 74  
         public void loadRepositoryDescriptor(String ojbRepositoryFilePath) {
 75  0
                 if ( LOG.isInfoEnabled() ) {
 76  0
                         LOG.info("Begin loading OJB Metadata for: " + ojbRepositoryFilePath);
 77  
                 }
 78  0
                 DefaultResourceLoader resourceLoader = new DefaultResourceLoader(ClassLoaderUtils.getDefaultClassLoader());
 79  0
                 InputStream is = null;
 80  
                 try {
 81  0
                         is = resourceLoader.getResource(CLASSPATH_RESOURCE_PREFIX + ojbRepositoryFilePath).getInputStream();
 82  0
                         ConnectionRepository cr = MetadataManager.getInstance().readConnectionRepository(is);
 83  0
                         MetadataManager.getInstance().mergeConnectionRepository(cr);
 84  
 
 85  0
                         is = resourceLoader.getResource(CLASSPATH_RESOURCE_PREFIX + ojbRepositoryFilePath).getInputStream();
 86  0
                         DescriptorRepository dr = MetadataManager.getInstance().readDescriptorRepository(is);
 87  0
                         MetadataManager.getInstance().mergeDescriptorRepository(dr);
 88  
 
 89  0
                         if (LOG.isDebugEnabled()) {
 90  0
                                 LOG.debug("--------------------------------------------------------------------------");
 91  0
                                 LOG.debug("Merging repository descriptor: " + ojbRepositoryFilePath);
 92  0
                                 LOG.debug("--------------------------------------------------------------------------");
 93  
                         }
 94  0
                 } catch (IOException ioe) {
 95  0
                         if (is != null) {
 96  
                                 try {
 97  0
                                         is.close();
 98  0
                                 } catch (IOException e) {
 99  0
                                         LOG.warn("Failed to close InputStream on OJB repository path " + ojbRepositoryFilePath, e);
 100  0
                                 }
 101  
                         }
 102  0
                         throw new RiceRuntimeException(ioe);
 103  
                 } finally {
 104  0
                         if (is != null) {
 105  
                                 try {
 106  0
                                         is.close();
 107  0
                                 } catch (IOException e) {
 108  0
                                         LOG.warn("Failed to close InputStream on OJB repository path " + ojbRepositoryFilePath, e);
 109  0
                                 }
 110  
                         }
 111  0
                 }
 112  0
                 if ( LOG.isInfoEnabled() ) {
 113  0
                         LOG.info("Finished loading OJB Metadata for: " + ojbRepositoryFilePath);
 114  
                 }
 115  0
         }
 116  
 
 117  
     /**
 118  
          * @see org.kuali.rice.kns.service.PersistenceService#retrieveNonKeyFields(java.lang.Object)
 119  
          */
 120  
     public void retrieveNonKeyFields(Object persistableObject) {
 121  0
         if (persistableObject == null) {
 122  0
             throw new IllegalArgumentException("invalid (null) persistableObject");
 123  
         }
 124  0
         if ( LOG.isDebugEnabled() ) {
 125  0
                 LOG.debug("retrieving non-key fields for " + persistableObject);
 126  
         }
 127  
 
 128  0
         persistenceDao.retrieveAllReferences(persistableObject);
 129  0
     }
 130  
 
 131  
     /**
 132  
          * @see org.kuali.rice.kns.service.PersistenceService#retrieveReferenceObject(java.lang.Object,
 133  
          *      String referenceObjectName)
 134  
      */
 135  
     public void retrieveReferenceObject(Object persistableObject, String referenceObjectName) {
 136  0
         if (persistableObject == null) {
 137  0
             throw new IllegalArgumentException("invalid (null) persistableObject");
 138  
         }
 139  0
         if ( LOG.isDebugEnabled() ) {
 140  0
                 LOG.debug("retrieving reference object " + referenceObjectName + " for " + persistableObject);
 141  
         }
 142  0
         persistenceDao.retrieveReference(persistableObject, referenceObjectName);
 143  0
     }
 144  
 
 145  
     /**
 146  
          * @see org.kuali.rice.kns.service.PersistenceService#retrieveReferenceObject(java.lang.Object,
 147  
          *      String referenceObjectName)
 148  
      */
 149  
     public void retrieveReferenceObjects(Object persistableObject, List referenceObjectNames) {
 150  0
         if (persistableObject == null) {
 151  0
             throw new IllegalArgumentException("invalid (null) persistableObject");
 152  
         }
 153  0
         if (referenceObjectNames == null) {
 154  0
             throw new IllegalArgumentException("invalid (null) referenceObjectNames");
 155  
         }
 156  0
         if (referenceObjectNames.isEmpty()) {
 157  0
             throw new IllegalArgumentException("invalid (empty) referenceObjectNames");
 158  
         }
 159  
 
 160  0
         int index = 0;
 161  0
         for (Iterator i = referenceObjectNames.iterator(); i.hasNext(); index++) {
 162  0
             String referenceObjectName = (String) i.next();
 163  0
             if (StringUtils.isBlank(referenceObjectName)) {
 164  0
                 throw new IllegalArgumentException("invalid (blank) name at position " + index);
 165  
             }
 166  
 
 167  0
             retrieveReferenceObject(persistableObject, referenceObjectName);
 168  
         }
 169  0
     }
 170  
 
 171  
     /**
 172  
          * @see org.kuali.rice.kns.service.PersistenceService#retrieveReferenceObject(java.lang.Object,
 173  
          *      String referenceObjectName)
 174  
      */
 175  
     public void retrieveReferenceObjects(List persistableObjects, List referenceObjectNames) {
 176  0
         if (persistableObjects == null) {
 177  0
             throw new IllegalArgumentException("invalid (null) persistableObjects");
 178  
         }
 179  0
         if (persistableObjects.isEmpty()) {
 180  0
             throw new IllegalArgumentException("invalid (empty) persistableObjects");
 181  
         }
 182  0
         if (referenceObjectNames == null) {
 183  0
             throw new IllegalArgumentException("invalid (null) referenceObjectNames");
 184  
         }
 185  0
         if (referenceObjectNames.isEmpty()) {
 186  0
             throw new IllegalArgumentException("invalid (empty) referenceObjectNames");
 187  
         }
 188  
 
 189  0
         for (Iterator i = persistableObjects.iterator(); i.hasNext();) {
 190  0
             Object persistableObject = i.next();
 191  0
             retrieveReferenceObjects(persistableObject, referenceObjectNames);
 192  0
         }
 193  0
     }
 194  
 
 195  
 
 196  
     /**
 197  
      * @see org.kuali.rice.kns.service.PersistenceService#getFlattenedPrimaryKeyFieldValues(java.lang.Object)
 198  
      */
 199  
     public String getFlattenedPrimaryKeyFieldValues(Object persistableObject) {
 200  0
         if (persistableObject == null) {
 201  0
             throw new IllegalArgumentException("invalid (null) persistableObject");
 202  
         }
 203  0
         Map primaryKeyValues = getPrimaryKeyFieldValues(persistableObject, true);
 204  
 
 205  0
         StringBuffer flattened = new StringBuffer(persistableObject.getClass().getName());
 206  0
         flattened.append("(");
 207  0
         for (Iterator i = primaryKeyValues.entrySet().iterator(); i.hasNext();) {
 208  0
             Map.Entry e = (Map.Entry) i.next();
 209  
 
 210  0
             String fieldName = (String) e.getKey();
 211  0
             Object fieldValue = e.getValue();
 212  
 
 213  0
             flattened.append(fieldName + "=" + fieldValue);
 214  0
             if (i.hasNext()) {
 215  0
                 flattened.append(",");
 216  
             }
 217  0
         }
 218  
 
 219  0
         flattened.append(")");
 220  
 
 221  0
         return flattened.toString();
 222  
 
 223  
     }
 224  
 
 225  
     private void linkObjectsWithCircularReferenceCheck(Object persistableObject, Set referenceSet) {
 226  0
         if (ObjectUtils.isNull(persistableObject) || referenceSet.contains(persistableObject)) {
 227  0
             return;
 228  
         }
 229  0
         referenceSet.add(persistableObject);
 230  0
         ClassDescriptor classDescriptor = getClassDescriptor(persistableObject.getClass());
 231  
 
 232  0
         String className = null;
 233  0
         String fieldName = null;
 234  
         try {
 235  
             // iterate through all object references for the persistableObject
 236  0
             Vector objectReferences = classDescriptor.getObjectReferenceDescriptors();
 237  0
             for (Iterator iter = objectReferences.iterator(); iter.hasNext();) {
 238  0
                 ObjectReferenceDescriptor referenceDescriptor = (ObjectReferenceDescriptor) iter.next();
 239  
 
 240  
                 // get the actual reference object
 241  0
                 className = persistableObject.getClass().getName();
 242  0
                 fieldName = referenceDescriptor.getAttributeName();
 243  0
                 Object referenceObject = PropertyUtils.getProperty(persistableObject, fieldName);
 244  0
                 if (ObjectUtils.isNull(referenceObject) || referenceSet.contains(referenceObject)) {
 245  0
                     continue;
 246  
                 }
 247  
 
 248  
                 // recursively link object
 249  0
                 linkObjectsWithCircularReferenceCheck(referenceObject, referenceSet);
 250  
 
 251  
                                 // iterate through the keys for the reference object and set
 252  
                                 // value
 253  0
                 FieldDescriptor[] refFkNames = referenceDescriptor.getForeignKeyFieldDescriptors(classDescriptor);
 254  0
                 ClassDescriptor refCld = getClassDescriptor(referenceDescriptor.getItemClass());
 255  0
                 FieldDescriptor[] refPkNames = refCld.getPkFields();
 256  
 
 257  0
                 Map objFkValues = new HashMap();
 258  0
                 for (int i = 0; i < refPkNames.length; i++) {
 259  0
                     objFkValues.put(refFkNames[i].getAttributeName(), ObjectUtils.getPropertyValue(referenceObject, refPkNames[i].getAttributeName()));
 260  
                 }
 261  
 
 262  0
                 for (int i = 0; i < refFkNames.length; i++) {
 263  0
                     FieldDescriptor fkField = refFkNames[i];
 264  0
                     String fkName = fkField.getAttributeName();
 265  
 
 266  
                                         // if the fk from object and use if main object does not
 267  
                                         // have value
 268  0
                     Object fkValue = null;
 269  0
                     if (objFkValues.containsKey(fkName)) {
 270  0
                         fkValue = objFkValues.get(fkName);
 271  
                     }
 272  
 
 273  
                     // if fk is set in main object, take value from there
 274  0
                     Object mainFkValue = ObjectUtils.getPropertyValue(persistableObject, fkName);
 275  0
                     if (ObjectUtils.isNotNull(mainFkValue) && StringUtils.isNotBlank(mainFkValue.toString())) {
 276  0
                         fkValue = mainFkValue;
 277  0
                                         } else if (ObjectUtils.isNull(fkValue) || StringUtils.isBlank(fkValue.toString())) {
 278  
                                                 // find the value from one of the other reference
 279  
                                                 // objects
 280  0
                         for (Iterator iter2 = objectReferences.iterator(); iter2.hasNext();) {
 281  0
                             ObjectReferenceDescriptor checkDescriptor = (ObjectReferenceDescriptor) iter2.next();
 282  
 
 283  0
                             fkValue = getReferenceFKValue(persistableObject, checkDescriptor, fkName);
 284  0
                             if (ObjectUtils.isNotNull(fkValue) && StringUtils.isNotBlank(fkValue.toString())) {
 285  0
                                 break;
 286  
                             }
 287  0
                         }
 288  
                     }
 289  
 
 290  
                     // set the fk value
 291  0
                     if (ObjectUtils.isNotNull(fkValue)) {
 292  0
                         fieldName = refPkNames[i].getAttributeName();
 293  0
                         ObjectUtils.setObjectProperty(referenceObject, fieldName, fkValue.getClass(), fkValue);
 294  
 
 295  
                         // set fk in main object
 296  0
                         if (ObjectUtils.isNull(mainFkValue)) {
 297  0
                             ObjectUtils.setObjectProperty(persistableObject, fkName, fkValue.getClass(), fkValue);
 298  
                         }
 299  
                     }
 300  
                 }
 301  0
             }
 302  0
                 } catch (NoSuchMethodException e) {
 303  0
             throw new IntrospectionException("no setter for property '" + className + "." + fieldName + "'", e);
 304  0
                 } catch (IllegalAccessException e) {
 305  0
             throw new IntrospectionException("problem accessing property '" + className + "." + fieldName + "'", e);
 306  0
                 } catch (InvocationTargetException e) {
 307  0
             throw new IntrospectionException("problem invoking getter for property '" + className + "." + fieldName + "'", e);
 308  0
         }
 309  0
     }
 310  
 
 311  
     /**
 312  
          * For each reference object to the parent persistableObject, sets the key
 313  
          * values for that object. First, if the reference object already has a
 314  
          * value for the key, the value is left unchanged. Otherwise, for
 315  
          * non-anonymous keys, the value is taken from the parent object. For
 316  
          * anonymous keys, all other persistableObjects are checked until a value
 317  
          * for the key is found.
 318  
      * 
 319  
      * @see org.kuali.rice.kns.service.PersistenceService#getReferencedObject(java.lang.Object,
 320  
      *      org.apache.ojb.broker.metadata.ObjectReferenceDescriptor)
 321  
      */
 322  
     public void linkObjects(Object persistableObject) {
 323  0
         linkObjectsWithCircularReferenceCheck(persistableObject, new HashSet());
 324  0
     }
 325  
 
 326  
     /**
 327  
      * 
 328  
      * @see org.kuali.rice.kns.service.PersistenceService#allForeignKeyValuesPopulatedForReference(org.kuali.rice.kns.bo.BusinessObject,
 329  
      *      java.lang.String)
 330  
      */
 331  
     public boolean allForeignKeyValuesPopulatedForReference(PersistableBusinessObject bo, String referenceName) {
 332  
 
 333  0
         boolean allFkeysHaveValues = true;
 334  
 
 335  
         // yelp if nulls were passed in
 336  0
         if (bo == null) {
 337  0
             throw new IllegalArgumentException("The Class passed in for the BusinessObject argument was null.");
 338  
         }
 339  0
         if (StringUtils.isBlank(referenceName)) {
 340  0
             throw new IllegalArgumentException("The String passed in for the referenceName argument was null or empty.");
 341  
         }
 342  
 
 343  0
         PropertyDescriptor propertyDescriptor = null;
 344  
 
 345  
         // make sure the attribute exists at all, throw exception if not
 346  
         try {
 347  0
             propertyDescriptor = PropertyUtils.getPropertyDescriptor(bo, referenceName);
 348  0
                 } catch (Exception e) {
 349  0
             throw new RuntimeException(e);
 350  0
         }
 351  0
         if (propertyDescriptor == null) {
 352  0
             throw new ReferenceAttributeDoesntExistException("Requested attribute: '" + referenceName + "' does not exist " + "on class: '" + bo.getClass().getName() + "'.");
 353  
         }
 354  
 
 355  
         // get the class of the attribute name
 356  0
         Class referenceClass = getBusinessObjectAttributeClass( bo.getClass(), referenceName );
 357  0
         if ( referenceClass == null ) {
 358  0
                 referenceClass = propertyDescriptor.getPropertyType();
 359  
         }
 360  
 
 361  
         // make sure the class of the attribute descends from BusinessObject,
 362  
         // otherwise throw an exception
 363  0
         if (!PersistableBusinessObject.class.isAssignableFrom(referenceClass)) {
 364  0
                         throw new ObjectNotABusinessObjectRuntimeException("Attribute requested (" + referenceName + ") is of class: " + "'" + referenceClass.getName() + "' and is not a " + "descendent of BusinessObject.  Only descendents of BusinessObject "
 365  
                                         + "can be used.");
 366  
         }
 367  
 
 368  
                 // make sure the attribute designated is listed as a
 369  
                 // reference-descriptor
 370  
                 // on the clazz specified, otherwise throw an exception (OJB);
 371  0
         ClassDescriptor classDescriptor = getClassDescriptor(bo.getClass());
 372  0
         ObjectReferenceDescriptor referenceDescriptor = classDescriptor.getObjectReferenceDescriptorByName(referenceName);
 373  0
         if (referenceDescriptor == null) {
 374  0
             throw new ReferenceAttributeNotAnOjbReferenceException("Attribute requested (" + referenceName + ") is not listed " + "in OJB as a reference-descriptor for class: '" + bo.getClass().getName() + "'");
 375  
         }
 376  
 
 377  
                 // get the list of the foreign-keys for this reference-descriptor
 378  
                 // (OJB)
 379  0
         Vector fkFields = referenceDescriptor.getForeignKeyFields();
 380  0
         Iterator fkIterator = fkFields.iterator();
 381  
 
 382  
         // walk through the list of the foreign keys, get their types
 383  0
         while (fkIterator.hasNext()) {
 384  
 
 385  
             // get the field name of the fk & pk field
 386  0
             String fkFieldName = (String) fkIterator.next();
 387  
 
 388  
             // get the value for the fk field
 389  0
             Object fkFieldValue = null;
 390  
             try {
 391  0
                 fkFieldValue = PropertyUtils.getSimpleProperty(bo, fkFieldName);
 392  
             }
 393  
 
 394  
             // if we cant retrieve the field value, then
 395  
             // it doesnt have a value
 396  0
             catch (IllegalAccessException e) {
 397  0
                 return false;
 398  0
                         } catch (InvocationTargetException e) {
 399  0
                 return false;
 400  0
                         } catch (NoSuchMethodException e) {
 401  0
                 return false;
 402  0
             }
 403  
 
 404  
             // test the value
 405  0
             if (fkFieldValue == null) {
 406  0
                 return false;
 407  0
                         } else if (String.class.isAssignableFrom(fkFieldValue.getClass())) {
 408  0
                 if (StringUtils.isBlank((String) fkFieldValue)) {
 409  0
                     return false;
 410  
                 }
 411  
             }
 412  0
         }
 413  
         
 414  0
         return allFkeysHaveValues;
 415  
     }
 416  
 
 417  
     /**
 418  
      * 
 419  
      * @see org.kuali.rice.kns.service.PersistenceService#refreshAllNonUpdatingReferences(org.kuali.rice.kns.bo.BusinessObject)
 420  
      */
 421  
     public void refreshAllNonUpdatingReferences(PersistableBusinessObject bo) {
 422  
 
 423  
         // get the OJB class-descriptor for the bo class
 424  0
         ClassDescriptor classDescriptor = getClassDescriptor(bo.getClass());
 425  
 
 426  
         // get a list of all reference-descriptors for that class
 427  0
         Vector references = classDescriptor.getObjectReferenceDescriptors();
 428  
 
 429  
         // walk through all of the reference-descriptors
 430  0
         for (Iterator iter = references.iterator(); iter.hasNext();) {
 431  0
             ObjectReferenceDescriptor reference = (ObjectReferenceDescriptor) iter.next();
 432  
 
 433  
             // if its NOT an updateable reference, then lets refresh it
 434  0
             if (reference.getCascadingStore() == ObjectReferenceDescriptor.CASCADE_NONE) {
 435  0
                 PersistentField persistentField = reference.getPersistentField();
 436  0
                 String referenceName = persistentField.getName();
 437  0
                 retrieveReferenceObject(bo, referenceName);
 438  
             }
 439  0
         }
 440  0
     }
 441  
 
 442  
     private Object getReferenceFKValue(Object persistableObject, ObjectReferenceDescriptor chkRefCld, String fkName) {
 443  0
         ClassDescriptor classDescriptor = getClassDescriptor(persistableObject.getClass());
 444  0
         Object referenceObject = ObjectUtils.getPropertyValue(persistableObject, chkRefCld.getAttributeName());
 445  
 
 446  0
         if (referenceObject == null) {
 447  0
             return null;
 448  
         }
 449  
 
 450  0
         FieldDescriptor[] refFkNames = chkRefCld.getForeignKeyFieldDescriptors(classDescriptor);
 451  0
         ClassDescriptor refCld = getClassDescriptor(chkRefCld.getItemClass());
 452  0
         FieldDescriptor[] refPkNames = refCld.getPkFields();
 453  
 
 454  
 
 455  0
         Object fkValue = null;
 456  0
         for (int i = 0; i < refFkNames.length; i++) {
 457  0
             FieldDescriptor fkField = refFkNames[i];
 458  
 
 459  0
             if (fkField.getAttributeName().equals(fkName)) {
 460  0
                 fkValue = ObjectUtils.getPropertyValue(referenceObject, refPkNames[i].getAttributeName());
 461  0
                 break;
 462  
             }
 463  
         }
 464  
 
 465  0
         return fkValue;
 466  
     }
 467  
 
 468  
     
 469  
     /**
 470  
      * Sets the persistenceDao attribute value.
 471  
          * 
 472  
          * @param persistenceDao
 473  
          *            The persistenceDao to set.
 474  
      */
 475  
     public void setPersistenceDao(PersistenceDao persistenceDao) {
 476  0
         this.persistenceDao = persistenceDao;
 477  0
     }
 478  
 }