Java Doc for CircularTest.java in  » Database-ORM » db-ojb » org » apache » ojb » odmg » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » db ojb » org.apache.ojb.odmg 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.ojb.junit.ODMGTestCase
   org.apache.ojb.odmg.CircularTest

CircularTest
public class CircularTest extends ODMGTestCase (Code)
Testing complex object graphs with circular and bidirectional references when using database foreign key settings (without support of deferred foreign keys).

The classes hierarchy looks like:
Class Shop has a bidirectional 1:1 reference with ShopDetail.
Shop has a 1:n relation with Product, Product has a 1:1 reference to Shop.
Shop has a m:n relation with Distributor.
Product has a 1:n relation to itself to handle sub-Products.

In the database the following foreign keys are declared:
- Shop has a FK to ShopDetail
- Product has a FK to Product
- Product has a FK to Shop
- CT_SHOP_DISTRIBUTOR indirection table has FK's to Shop and Distributor

Here a summery of the dependencies:
Shop--1:1-->ShopDetail--1:1-->Shop
Shop--1:n-->Product--1:1-->Shop
Product--1:n-->Product
Shop--m:n-->Distributor

Class ObjectA has a 1:1 reference to ObjectAA,
ObjectAA has 1:1 to ObjectAAA,
ObjectAAA has 1:1 to ObjectA and to ObjectAAAA,
ObjectAAAA has 1:1 to ObjectA

- ObjectA has FK to ObjectAA
- ObjectAA has FK to ObjectAAA
- ObjectAAA has FK to ObjectAAAA

Here a summery of the dependencies:
ObjetA--1:1-->ObjectAA--1:1-->ObjectAAA--1:1-->ObjectA ObjetA--1:1-->ObjectAA--1:1-->ObjectAAA--1:1-->ObjectAAAA--1:1-->ObjectA
version:
   $Id: CircularTest.java,v 1.1.2.10 2005/12/21 22:31:28 tomdz Exp $


Inner Class :public static class Shop
Inner Class :public static class Distributor
Inner Class :public static class Product
Inner Class :public static class ShopDetail
Inner Class :abstract static class BaseObject
Inner Class :public static class ObjectA extends BaseObject
Inner Class :public static class ObjectAA extends BaseObject
Inner Class :public static class ObjectAAA extends BaseObject
Inner Class :public static class ObjectAAAA extends BaseObject



Method Summary
public static  voidmain(String[] args)
    
public  voidtestAutoDeleteEnabledNonCircular()
     Use auto-delete setting to delete object graph.
public  voidtestBidirectionalWithConstraint_1a()
     Handle circuler 1:1 with default methods.
public  voidtestBidirectionalWithConstraint_1b()
     Define order of object operations using flush() method.
public  voidtestBidirectionalWithConstraint_1c()
     If the user take care of the ordering itself the test pass.
public  voidtestBidirectionalWithConstraint_1d_PB()
     This test is only for comparison of ODMG- with PB-api.
public  voidtestBidirectionalWithConstraint_1e()
     Handle circular 1:1 by using a 'constraint'-flag property in reference-descriptor to make OJB's ordering algorithm more sophisticated.
public  voidtestBidirectionalWithConstraint_2a()
     Class Shop has a bidirectional 1:1 reference with ShopDetail (FK constraint from SHOP to SHOP_DETAIL table).
public  voidtestBidirectionalWithConstraint_2b()
     Class Shop has a bidirectional 1:1 reference with ShopDetail and the DB table of Shop has a foreign key constraint on ShopDetail table.
public  voidtestBidirectionalWithConstraint_2d()
     Class Shop has a bidirectional 1:1 reference with ShopDetail and the DB table of Shop has a foreign key constraint on ShopDetail table.
public  voidtestCircularOneToN_1()
     Handling circular 1:n references with FK settings and use of auto-delete setting to delete object graph.
public  voidtestCircularOneToN_2()
     Handling circular 1:n references with FK settings and use of auto-delete setting to delete object graph.
public  voidtestCircularOneToN_3()
     Handling circular 1:n references with FK settings and use of auto-delete setting to delete object graph.
public  voidtestCircularOneToOne_1a()
     Test show handling with circular references and database FK settings.
public  voidtestCircularOneToOne_1b()
     Test show handling with circular references and database FK settings.
public  voidtestCircularOneToOne_1c()
     Do manually ordering using TransactionExt.setOrdering(boolean) to disable OJB's ordering algorithm (and implicit locking).
public  voidtestCircularOneToOne_1dd()
     Do manually ordering using in conjunction with OJB's ordering.
public  voidtestCircularOneToOne_1e()
    
public  voidtestCircularOneToOne_2a()
     User take care of the ordering itself.
public  voidtestCircularOneToOne_PB_a()
     This test is only for comparison of ODMG- with PB-api.
public  voidtestCircularOneToOne_PB_b()
     This test is only for comparison of ODMG- with PB-api.
public  voidtestCircularWithAutoDeleteEnabled()
     Use auto-delete setting to delete object graph.
public  voidtestMtoNWithBackReference_2()
    
public  voidtestOneToNWithSelfReference_1()
    
public  voidtestOneToNWithSelfReference_2()
    
public  voidtestOneToNWithSelfReference_3()
    
public  voidtestOneToOneWithBackReference_1()
    
public  voidtestOneToOneWithBackReference_2()
    
public  voidtestOneToOneWithBackReference_3()
    



Method Detail
main
public static void main(String[] args)(Code)



testAutoDeleteEnabledNonCircular
public void testAutoDeleteEnabledNonCircular() throws Exception(Code)
Use auto-delete setting to delete object graph.



testBidirectionalWithConstraint_1a
public void testBidirectionalWithConstraint_1a() throws Exception(Code)
Handle circuler 1:1 with default methods.



testBidirectionalWithConstraint_1b
public void testBidirectionalWithConstraint_1b() throws Exception(Code)
Define order of object operations using flush() method.



testBidirectionalWithConstraint_1c
public void testBidirectionalWithConstraint_1c() throws Exception(Code)
If the user take care of the ordering itself the test pass.



testBidirectionalWithConstraint_1d_PB
public void testBidirectionalWithConstraint_1d_PB() throws Exception(Code)
This test is only for comparison of ODMG- with PB-api. It's not recommended to do this in ODMG production environment.
throws:
  Exception -



testBidirectionalWithConstraint_1e
public void testBidirectionalWithConstraint_1e() throws Exception(Code)
Handle circular 1:1 by using a 'constraint'-flag property in reference-descriptor to make OJB's ordering algorithm more sophisticated.



testBidirectionalWithConstraint_2a
public void testBidirectionalWithConstraint_2a() throws Exception(Code)
Class Shop has a bidirectional 1:1 reference with ShopDetail (FK constraint from SHOP to SHOP_DETAIL table). Shop has a m:n relation with Distributor.



testBidirectionalWithConstraint_2b
public void testBidirectionalWithConstraint_2b() throws Exception(Code)
Class Shop has a bidirectional 1:1 reference with ShopDetail and the DB table of Shop has a foreign key constraint on ShopDetail table. Shop has a m:n relation with Distributor.

If the user take care of the ordering itself the test pass.




testBidirectionalWithConstraint_2d
public void testBidirectionalWithConstraint_2d() throws Exception(Code)
Class Shop has a bidirectional 1:1 reference with ShopDetail and the DB table of Shop has a foreign key constraint on ShopDetail table. Shop has a m:n relation with Distributor.

If the user take care of the ordering itself the test pass.




testCircularOneToN_1
public void testCircularOneToN_1() throws Exception(Code)
Handling circular 1:n references with FK settings and use of auto-delete setting to delete object graph.



testCircularOneToN_2
public void testCircularOneToN_2() throws Exception(Code)
Handling circular 1:n references with FK settings and use of auto-delete setting to delete object graph.



testCircularOneToN_3
public void testCircularOneToN_3() throws Exception(Code)
Handling circular 1:n references with FK settings and use of auto-delete setting to delete object graph.



testCircularOneToOne_1a
public void testCircularOneToOne_1a() throws Exception(Code)
Test show handling with circular references and database FK settings.



testCircularOneToOne_1b
public void testCircularOneToOne_1b() throws Exception(Code)
Test show handling with circular references and database FK settings.



testCircularOneToOne_1c
public void testCircularOneToOne_1c() throws Exception(Code)
Do manually ordering using TransactionExt.setOrdering(boolean) to disable OJB's ordering algorithm (and implicit locking).



testCircularOneToOne_1dd
public void testCircularOneToOne_1dd() throws Exception(Code)
Do manually ordering using in conjunction with OJB's ordering.



testCircularOneToOne_1e
public void testCircularOneToOne_1e() throws Exception(Code)



testCircularOneToOne_2a
public void testCircularOneToOne_2a() throws Exception(Code)
User take care of the ordering itself.



testCircularOneToOne_PB_a
public void testCircularOneToOne_PB_a() throws Exception(Code)
This test is only for comparison of ODMG- with PB-api. It's not recommended to do this in ODMG production environment. Handling of circular 1:1 reference: ObjetA--1:1-->ObjectAA--1:1-->ObjectAAA--1:1-->ObjectA when each object has a FK constraint to it's reference.
throws:
  Exception -



testCircularOneToOne_PB_b
public void testCircularOneToOne_PB_b() throws Exception(Code)
This test is only for comparison of ODMG- with PB-api. It's not recommended to do this in ODMG production environment. Handling of circular 1:1 reference: ObjetA--1:1-->ObjectAA--1:1-->ObjectAAA--1:1-->ObjectA when each object has a FK constraint to it's reference.
throws:
  Exception -



testCircularWithAutoDeleteEnabled
public void testCircularWithAutoDeleteEnabled() throws Exception(Code)
Use auto-delete setting to delete object graph.



testMtoNWithBackReference_2
public void testMtoNWithBackReference_2() throws Exception(Code)



testOneToNWithSelfReference_1
public void testOneToNWithSelfReference_1() throws Exception(Code)



testOneToNWithSelfReference_2
public void testOneToNWithSelfReference_2() throws Exception(Code)



testOneToNWithSelfReference_3
public void testOneToNWithSelfReference_3() throws Exception(Code)



testOneToOneWithBackReference_1
public void testOneToOneWithBackReference_1() throws Exception(Code)



testOneToOneWithBackReference_2
public void testOneToOneWithBackReference_2() throws Exception(Code)



testOneToOneWithBackReference_3
public void testOneToOneWithBackReference_3() throws Exception(Code)



Fields inherited from org.apache.ojb.junit.ODMGTestCase
public Database database(Code)(Java Doc)
public ImplementationExt odmg(Code)(Java Doc)

Methods inherited from org.apache.ojb.junit.ODMGTestCase
protected void setUp() throws Exception(Code)(Java Doc)
protected void tearDown() throws Exception(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.