View Javadoc
1   /**
2    * Copyright 2005-2014 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.dao.impl;
17  
18  import org.apache.ojb.broker.Identity;
19  import org.apache.ojb.broker.core.IdentityFactoryImpl;
20  import org.apache.ojb.broker.core.proxy.IndirectionHandlerCGLIBImpl;
21  import org.apache.ojb.broker.core.proxy.ProxyHelper;
22  import org.kuali.rice.core.framework.persistence.ojb.dao.PlatformAwareDaoBaseOjb;
23  import org.kuali.rice.krad.dao.PersistenceDao;
24  import org.kuali.rice.krad.util.LegacyDataFramework;
25  
26  @Deprecated
27  @LegacyDataFramework
28  public class PersistenceDaoOjb extends PlatformAwareDaoBaseOjb implements PersistenceDao {
29  
30      /**
31       * @see org.kuali.rice.krad.dao.PersistenceDao#clearCache()
32       */
33      @Override
34  	public void clearCache() {
35          getPersistenceBroker(true).clearCache();
36      }
37  
38      /**
39       * @see org.kuali.rice.krad.dao.PersistenceDao#resolveProxy(java.lang.Object)
40       */
41      @Override
42  	public Object resolveProxy(Object o) {
43          Identity ident = new IdentityFactoryImpl(getPersistenceBroker(true)).buildIdentity(o);
44          IndirectionHandlerCGLIBImpl ih = new IndirectionHandlerCGLIBImpl(getPersistenceBroker(true).getPBKey(), ident);
45          return ih.getRealSubject();
46      }
47  
48      /**
49       * @see org.kuali.rice.krad.dao.PersistenceDao#retrieveAllReferences(java.lang.Object)
50       */
51      @Override
52  	public void retrieveAllReferences(Object o) {
53          getPersistenceBroker(true).retrieveAllReferences(o);
54      }
55  
56      /**
57       * @see org.kuali.rice.krad.dao.PersistenceDao#retrieveReference(java.lang.Object, java.lang.String)
58       */
59      @Override
60  	public void retrieveReference(Object o, String referenceName) {
61          getPersistenceBroker(true).retrieveReference(o, referenceName);
62      }
63  
64  	/**
65  	 * Asks ProxyHelper if the object is proxied
66  	 *
67  	 * @see org.kuali.rice.krad.dao.PersistenceDao#isProxied(java.lang.Object)
68  	 */
69  	@Override
70  	public boolean isProxied(Object object) {
71  		return ProxyHelper.isProxy(object);
72  	}
73  
74  }