View Javadoc

1   /**
2    * Copyright 2005-2013 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.krad.service;
17  
18  import org.kuali.rice.krad.bo.PersistableBusinessObject;
19  import org.kuali.rice.krad.util.LegacyDataFramework;
20  
21  import java.util.List;
22  import java.util.Map;
23  
24  /**
25   * @author Kuali Rice Team (rice.collab@kuali.org)
26   * @deprecated use new KRAD Data framework {@link org.kuali.rice.krad.data.DataObjectService}
27   */
28  @Deprecated
29  @LegacyDataFramework
30  public interface PersistenceService {
31  
32      @Deprecated
33  	void loadRepositoryDescriptor(String ojbRepositoryFilePath);
34  
35      @Deprecated
36      void clearCache();
37  
38      @Deprecated
39      Object resolveProxy(Object o);
40  
41      /**
42       * @param persistableObject object whose primary key field name,value pairs you want
43       * @return a Map containing the names and values of fields specified the given class which are designated as key fields in the
44       *         OJB repository file
45       * @throws IllegalArgumentException if the given Object is null
46       * @throws org.kuali.rice.krad.exception.ClassNotPersistableException if the given object is of a type not described in the OJB repository
47       */
48      @Deprecated
49      Map getPrimaryKeyFieldValues(Object persistableObject);
50  
51      /**
52       * @param persistableObject object whose primary key field name,value pairs you want
53       * @param sortFieldNames if true, the returned Map will iterate through its entries sorted by fieldName
54       * @return a Map containing the names and values of fields specified the given class which are designated as key fields in the
55       *         OJB repository file
56       * @throws IllegalArgumentException if the given Object is null
57       * @throws org.kuali.rice.krad.exception.ClassNotPersistableException if the given object is of a type not described in the OJB repository
58       */
59      @Deprecated
60      Map getPrimaryKeyFieldValues(Object persistableObject, boolean sortFieldNames);
61  
62      /**
63       * @param persistableObject object whose objects need to be filled in based on primary keys
64       * @return the object whose key fields have just been retrieved
65       * @throws IllegalArgumentException if the given Object is null
66       * @throws org.kuali.rice.krad.exception.ClassNotPersistableException if the given object is of a type not described in the OJB repository
67       */
68      @Deprecated
69      void retrieveNonKeyFields(Object persistableObject);
70  
71      /**
72       * @param persistableObject object whose specified reference object needs to be filled in based on primary keys
73       * @param referenceObjectName the name of the reference object that will be filled in based on primary key values
74       * @throws IllegalArgumentException if the given Object is null
75       * @throws org.kuali.rice.krad.exception.ClassNotPersistableException if the given object is of a type not described in the OJB repository
76       */
77      @Deprecated
78      void retrieveReferenceObject(Object persistableObject, String referenceObjectName);
79  
80  
81      /**
82       * @param persistableObject object whose specified reference objects need to be filled in based on primary keys
83       * @param referenceObjectNames the names of the reference objects that will be filled in based on primary key values
84       * @throws IllegalArgumentException if either of the given lists is null or empty, or if any of the referenceObjectNames is
85       *         blank
86       * @throws org.kuali.rice.krad.exception.ClassNotPersistableException if the given object is of a type not described in the OJB repository
87       */
88      @Deprecated
89      void retrieveReferenceObjects(Object persistableObject, List referenceObjectNames);
90  
91      /**
92       * @param persistableObjects objects whose specified reference objects need to be filled in based on primary keys
93       * @param referenceObjectNames the names of the reference objects that will be filled in based on primary key values
94       * @throws IllegalArgumentException if either of the given lists is null or empty, or if any of the referenceObjectNames is
95       *         blank
96       * @throws org.kuali.rice.krad.exception.ClassNotPersistableException if the given object is of a type not described in the OJB repository
97       */
98      @Deprecated
99      void retrieveReferenceObjects(List persistableObjects, List referenceObjectNames);
100 
101 
102     /**
103      * @param persistableObject object whose objects need to have keys filled
104      * @return the object whose key fields have just been filled
105      * @throws IllegalArgumentException if the given Object is null
106      * @throws org.kuali.rice.krad.exception.ClassNotPersistableException if the given object is of a type not described in the OJB repository
107      */
108     @Deprecated
109     void linkObjects(Object persistableObject);
110 
111     /**
112      * @param persistableObject object whose primary key field name,value pairs you want
113      * @param bounded - whether to restrict the number of rows returned
114      * @return a String representation of the primary key fields and values for the given persistableObject
115      * @throws IllegalArgumentException if the given Object is null
116      * @throws org.kuali.rice.krad.exception.ClassNotPersistableException if the given object is of a type not described in the OJB repository
117      */
118     @Deprecated
119     String getFlattenedPrimaryKeyFieldValues(Object persistableObject);
120 
121     /**
122      * 
123      * This method examines whether all the foreign key fields for the specified reference contain values.
124      * 
125      * @param bo
126      * @param referenceName
127      * @return true if they all are accessible and have values, false otherwise
128      * 
129      */
130     @Deprecated
131     boolean allForeignKeyValuesPopulatedForReference(PersistableBusinessObject bo, String referenceName);
132 
133     /**
134      * 
135      * This method refreshes all reference objects to this main object that are 'non-updateable'. In general, this means that if a
136      * reference object is configured to not be updated when the parent document is saved, then they are non-updated.
137      * 
138      * This will not refresh updateable objects, which can cause problems when you're creating new objects.
139      * 
140      * See PersistenceServiceImpl.isUpdateableReference() for the full logic.
141      * 
142      * @param bo - the businessObject to be refreshed
143      * 
144      */
145     @Deprecated
146     void refreshAllNonUpdatingReferences(PersistableBusinessObject bo);
147 
148     
149     /**
150      * Determines if the given object is proxied by the ORM or not
151      * 
152      * @param object the object to determine if it is a proxy
153      * @return true if the object is an ORM proxy; false otherwise
154      */
155     @Deprecated
156     boolean isProxied(Object object);
157     
158     /**
159 	 * Determines if JPA is enabled for the KNS and for the given class
160 	 * 
161 	 * @param clazz the class to check for JPA enabling of
162 	 * @return true if JPA is enabled for the class, false otherwise
163 	 */
164     @Deprecated
165     boolean isJpaEnabledForKradClass(Class clazz);
166 
167 }