| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| PersistenceDaoOjb |
|
| 1.0;1 |
| 1 | /* | |
| 2 | * Copyright 2007 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.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.kns.dao.PersistenceDao; | |
| 23 | ||
| 24 | 0 | public class PersistenceDaoOjb extends PlatformAwareDaoBaseOjb implements PersistenceDao { |
| 25 | ||
| 26 | /** | |
| 27 | * @see org.kuali.rice.kns.dao.PersistenceDao#clearCache() | |
| 28 | */ | |
| 29 | public void clearCache() { | |
| 30 | 0 | getPersistenceBroker(true).clearCache(); |
| 31 | 0 | } |
| 32 | ||
| 33 | /** | |
| 34 | * @see org.kuali.rice.kns.dao.PersistenceDao#resolveProxy(java.lang.Object) | |
| 35 | */ | |
| 36 | public Object resolveProxy(Object o) { | |
| 37 | 0 | Identity ident = new IdentityFactoryImpl(getPersistenceBroker(true)).buildIdentity(o); |
| 38 | 0 | IndirectionHandlerCGLIBImpl ih = new IndirectionHandlerCGLIBImpl(getPersistenceBroker(true).getPBKey(), ident); |
| 39 | 0 | return ih.getRealSubject(); |
| 40 | } | |
| 41 | ||
| 42 | /** | |
| 43 | * @see org.kuali.rice.kns.dao.PersistenceDao#retrieveAllReferences(java.lang.Object) | |
| 44 | */ | |
| 45 | public void retrieveAllReferences(Object o) { | |
| 46 | 0 | getPersistenceBroker(true).retrieveAllReferences(o); |
| 47 | 0 | } |
| 48 | ||
| 49 | /** | |
| 50 | * @see org.kuali.rice.kns.dao.PersistenceDao#retrieveReference(java.lang.Object, java.lang.String) | |
| 51 | */ | |
| 52 | public void retrieveReference(Object o, String referenceName) { | |
| 53 | 0 | getPersistenceBroker(true).retrieveReference(o, referenceName); |
| 54 | 0 | } |
| 55 | ||
| 56 | /** | |
| 57 | * Asks ProxyHelper if the object is proxied | |
| 58 | * | |
| 59 | * @see org.kuali.rice.kns.dao.PersistenceDao#isProxied(java.lang.Object) | |
| 60 | */ | |
| 61 | public boolean isProxied(Object object) { | |
| 62 | 0 | return ProxyHelper.isProxy(object); |
| 63 | } | |
| 64 | ||
| 65 | } |