001/**
002 * Copyright 2005-2018 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krad.service;
017
018import org.kuali.rice.krad.bo.PersistableBusinessObject;
019import org.kuali.rice.krad.util.LegacyDataFramework;
020
021import java.util.List;
022import java.util.Map;
023
024/**
025 * @author Kuali Rice Team (rice.collab@kuali.org)
026 * @deprecated use new KRAD Data framework {@link org.kuali.rice.krad.data.DataObjectService}
027 */
028@Deprecated
029@LegacyDataFramework
030public interface PersistenceService {
031
032    @Deprecated
033        void loadRepositoryDescriptor(String ojbRepositoryFilePath);
034
035    @Deprecated
036    void clearCache();
037
038    @Deprecated
039    Object resolveProxy(Object o);
040
041    /**
042     * @param persistableObject object whose primary key field name,value pairs you want
043     * @return a Map containing the names and values of fields specified the given class which are designated as key fields in the
044     *         OJB repository file
045     * @throws IllegalArgumentException if the given Object is null
046     * @throws org.kuali.rice.krad.exception.ClassNotPersistableException if the given object is of a type not described in the OJB repository
047     */
048    @Deprecated
049    Map getPrimaryKeyFieldValues(Object persistableObject);
050
051    /**
052     * @param persistableObject object whose primary key field name,value pairs you want
053     * @param sortFieldNames if true, the returned Map will iterate through its entries sorted by fieldName
054     * @return a Map containing the names and values of fields specified the given class which are designated as key fields in the
055     *         OJB repository file
056     * @throws IllegalArgumentException if the given Object is null
057     * @throws org.kuali.rice.krad.exception.ClassNotPersistableException if the given object is of a type not described in the OJB repository
058     */
059    @Deprecated
060    Map getPrimaryKeyFieldValues(Object persistableObject, boolean sortFieldNames);
061
062    /**
063     * @param persistableObject object whose objects need to be filled in based on primary keys
064     * @return the object whose key fields have just been retrieved
065     * @throws IllegalArgumentException if the given Object is null
066     * @throws org.kuali.rice.krad.exception.ClassNotPersistableException if the given object is of a type not described in the OJB repository
067     */
068    @Deprecated
069    void retrieveNonKeyFields(Object persistableObject);
070
071    /**
072     * @param persistableObject object whose specified reference object needs to be filled in based on primary keys
073     * @param referenceObjectName the name of the reference object that will be filled in based on primary key values
074     * @throws IllegalArgumentException if the given Object is null
075     * @throws org.kuali.rice.krad.exception.ClassNotPersistableException if the given object is of a type not described in the OJB repository
076     */
077    @Deprecated
078    void retrieveReferenceObject(Object persistableObject, String referenceObjectName);
079
080
081    /**
082     * @param persistableObject object whose specified reference objects need to be filled in based on primary keys
083     * @param referenceObjectNames the names of the reference objects that will be filled in based on primary key values
084     * @throws IllegalArgumentException if either of the given lists is null or empty, or if any of the referenceObjectNames is
085     *         blank
086     * @throws org.kuali.rice.krad.exception.ClassNotPersistableException if the given object is of a type not described in the OJB repository
087     */
088    @Deprecated
089    void retrieveReferenceObjects(Object persistableObject, List referenceObjectNames);
090
091    /**
092     * @param persistableObjects objects whose specified reference objects need to be filled in based on primary keys
093     * @param referenceObjectNames the names of the reference objects that will be filled in based on primary key values
094     * @throws IllegalArgumentException if either of the given lists is null or empty, or if any of the referenceObjectNames is
095     *         blank
096     * @throws org.kuali.rice.krad.exception.ClassNotPersistableException if the given object is of a type not described in the OJB repository
097     */
098    @Deprecated
099    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}