| org.apache.ojb.junit.PBTestCase org.apache.ojb.broker.ProxyExamples
ProxyExamples | public class ProxyExamples extends PBTestCase (Code) | | Demo Application that shows basic concepts for Applications using the PersistenceBroker
as a mediator for persistence
|
Method Summary | |
public static void | main(String[] args) | public void | testCollectionProxies() | public void | testCollectionProxiesAndExtents() | public void | testDynamicProxies() This example shows how the PersistenceBroker can be used with a highly configurable proxy concept.
The main idea is, not to return materialized objects but rather lazy proxies, that defer materialization
until it is definitely neccesary (e.g. | public void | testProgrammedProxies() This example shows how the PersistenceBroker can be used with a highly configurable proxy concept.
The main idea is, not to return materialized objects but rather lazy proxies, that defer materialization
until it is definitely neccesary (e.g. | public void | testProxiesAndJDBCTransactionIsolation() Default the transaction isolation level of a JDBC connection is
READ-COMMITED.
So if a proxy uses another broker instance (i.e. | public void | testReferenceProxies() |
testCollectionProxies | public void testCollectionProxies() throws Exception(Code) | | |
testCollectionProxiesAndExtents | public void testCollectionProxiesAndExtents() throws Exception(Code) | | |
testDynamicProxies | public void testDynamicProxies()(Code) | | This example shows how the PersistenceBroker can be used with a highly configurable proxy concept.
The main idea is, not to return materialized objects but rather lazy proxies, that defer materialization
until it is definitely neccesary (e.g. reading an Objects attribute).
To achieve such a behaviour, you can define proxies for each persistent class.
As an example see the Repository.xml file in this examples directory.
It is not always the best option to use lazy materialization. The usage of proxies can be completely configured
in the xml repository. That is, if you decide not to use proxies, you don't have to change program-code,
but only out-comment the corresponding entry in the repos
itory.
|
testProgrammedProxies | public void testProgrammedProxies() throws Exception(Code) | | This example shows how the PersistenceBroker can be used with a highly configurable proxy concept.
The main idea is, not to return materialized objects but rather lazy proxies, that defer materialization
until it is definitely neccesary (e.g. reading an Objects attribute).
To achieve such a behaviour, you can define proxies for each persistent class.
As an example see the Repository.xml file in this examples directory.
It is not always the best option to use lazy materialization. The usage of proxies can be completely configured
in the xml repository. That is, if you decide not to use proxies, you don't have to change program-code,
but only out-comment the corresponding entry in the repos
itory.
|
testProxiesAndJDBCTransactionIsolation | public void testProxiesAndJDBCTransactionIsolation()(Code) | | Default the transaction isolation level of a JDBC connection is
READ-COMMITED.
So if a proxy uses another broker instance (i.e. JDBC connecction)
than the current one, it's possible that program blocks.
|
testReferenceProxies | public void testReferenceProxies()(Code) | | |
|
|