| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| PersistenceBrokerInternal |
|
| 1.0;1 |
| 1 | package org.apache.ojb.broker; | |
| 2 | ||
| 3 | /* Copyright 2002-2005 The Apache Software Foundation | |
| 4 | * | |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 6 | * you may not use this file except in compliance with the License. | |
| 7 | * You may obtain a copy of the License at | |
| 8 | * | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | * | |
| 11 | * Unless required by applicable law or agreed to in writing, software | |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 14 | * See the License for the specific language governing permissions and | |
| 15 | * limitations under the License. | |
| 16 | */ | |
| 17 | ||
| 18 | import org.apache.ojb.broker.accesslayer.RelationshipPrefetcherFactory; | |
| 19 | import org.apache.ojb.broker.core.QueryReferenceBroker; | |
| 20 | import org.apache.ojb.broker.core.proxy.ProxyFactory; | |
| 21 | import org.apache.ojb.broker.metadata.ClassDescriptor; | |
| 22 | ||
| 23 | /** | |
| 24 | * Extended version of the {@link PersistenceBroker} specifying additional functionality | |
| 25 | * that is only relevant internally. | |
| 26 | * | |
| 27 | * @author Armin Waibel | |
| 28 | * @version $Id: PersistenceBrokerInternal.java,v 1.1 2007-08-24 22:17:36 ewestfal Exp $ | |
| 29 | */ | |
| 30 | public interface PersistenceBrokerInternal extends PersistenceBroker | |
| 31 | { | |
| 32 | /** | |
| 33 | * Determines whether this instance is handled by a managed | |
| 34 | * environment, i.e. whether it is registered within a JTA transaction. | |
| 35 | * | |
| 36 | * @return <code>true</code> if this broker is managed | |
| 37 | */ | |
| 38 | public boolean isManaged(); | |
| 39 | ||
| 40 | /** | |
| 41 | * Specifies whether this instance is handled by a managed | |
| 42 | * environment, i.e. whether it is registered within a JTA transaction. | |
| 43 | * Note that on {@link #close()} this will automatically be reset | |
| 44 | * to <em>false</em>. | |
| 45 | * | |
| 46 | * @param managed <code>true</code> if this broker is managed | |
| 47 | */ | |
| 48 | public void setManaged(boolean managed); | |
| 49 | ||
| 50 | /** | |
| 51 | * Performs the real store work (insert or update) and is intended for use by | |
| 52 | * top-level apis internally. | |
| 53 | * | |
| 54 | * @param obj The object to store | |
| 55 | * @param oid The identity of the object to store | |
| 56 | * @param cld The class descriptor of the object | |
| 57 | * @param insert If <em>true</em> an insert operation will be performed, else update | |
| 58 | * operation | |
| 59 | * @param ignoreReferences Whether automatic storing of contained references/collections (except | |
| 60 | * super-references) shall be suppressed (independent of the auto-update | |
| 61 | * setting in the metadata) | |
| 62 | */ | |
| 63 | public void store(Object obj, Identity oid, ClassDescriptor cld, boolean insert, boolean ignoreReferences); | |
| 64 | ||
| 65 | /** | |
| 66 | * Deletes the persistence representation of the given object in the underlying | |
| 67 | * persistence system. This method is intended for use in top-level apis internally. | |
| 68 | * | |
| 69 | * @param obj The object to delete | |
| 70 | * @param ignoreReferences Whether automatic deletion of contained references/collections (except | |
| 71 | * super-references) shall be suppressed (independent of the auto-delete | |
| 72 | * setting in the metadata) | |
| 73 | */ | |
| 74 | public void delete(Object obj, boolean ignoreReferences) throws PersistenceBrokerException; | |
| 75 | ||
| 76 | /** | |
| 77 | * Returns the broker specifically for retrieving references via query. | |
| 78 | * | |
| 79 | * @return The query reference broker | |
| 80 | */ | |
| 81 | public QueryReferenceBroker getReferenceBroker(); | |
| 82 | ||
| 83 | /** | |
| 84 | * Refreshes the references of the given object whose <code>refresh</code> | |
| 85 | * is set to <code>true</code>. | |
| 86 | * | |
| 87 | * @param obj The object to check | |
| 88 | * @param oid The identity of the object | |
| 89 | * @param cld The class descriptor for the object | |
| 90 | */ | |
| 91 | public void checkRefreshRelationships(Object obj, Identity oid, ClassDescriptor cld); | |
| 92 | ||
| 93 | /** | |
| 94 | * Return the factory for creating relationship prefetcher objects. | |
| 95 | * | |
| 96 | * @return The factory | |
| 97 | */ | |
| 98 | public RelationshipPrefetcherFactory getRelationshipPrefetcherFactory(); | |
| 99 | ||
| 100 | /** | |
| 101 | * Return the factory for creating proxies. | |
| 102 | * | |
| 103 | * @return The factory | |
| 104 | */ | |
| 105 | public ProxyFactory getProxyFactory(); | |
| 106 | ||
| 107 | /** | |
| 108 | * Shortcut method for creating a proxy of the given type. | |
| 109 | * | |
| 110 | * @param proxyClass The proxy type | |
| 111 | * @param realSubjectsIdentity The identity of the real subject | |
| 112 | * @return The proxy | |
| 113 | */ | |
| 114 | public Object createProxy(Class proxyClass, Identity realSubjectsIdentity); | |
| 115 | } |