Java Doc for ObjectContainer.java in  » Database-DBMS » JODB » com » mobixess » jodb » soda » api » 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 DBMS » JODB » com.mobixess.jodb.soda.api 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.mobixess.jodb.soda.api.ObjectContainer

All known Subclasses:   com.mobixess.jodb.core.JODBSessionContainer,
ObjectContainer
public interface ObjectContainer (Code)
database engine interface.

The ObjectContainer interface provides all methods to store, retrieve and delete objects and to change object state.




Method Summary
public  voidactivate(Object obj, int depth)
     Activates all members on a stored object to the specified depth.
public  booleanclose()
     closes the ObjectContainer.
public  voidcommit()
     Commits the running transaction.
public  voiddeactivate(Object obj, int depth)
     deactivates a stored object by setting all members to NULL.
public  voiddelete(Object obj)
     deletes a stored object permanently.

Note that this method has to be called for every single object individually.
public  ObjectSet<T>get(Object template)
     Query-By-Example interface to retrieve objects.

get() creates an ObjectSet ObjectSet containing all objects in the ObjectContainer that match the passed template object.

Calling get(NULL) returns all objects stored in the ObjectContainer.


Query Evaluation
All non-null members of the template object are compared against all stored objects of the same class. Primitive type members are ignored if they are 0 or false respectively.

Returned Objects
The objects returned in the ObjectSet ObjectSet are instantiated and activated to the preconfigured depth.
public  Queryquery()
     creates a new S.O.D.A.
public  ObjectSet<Type>query(Class<Type> clazz)
     queries for all instances of a class.
Parameters:
  clazz - the class to query for.
public  voidrollback()
     rolls back the running transaction.
public  voidset(Object obj)
     Newly stores objects or updates stored objects.

An object not yet stored in the ObjectContainer will be stored when it is passed to set().
public  voidset(Object obj, int depth)
     Newly stores objects or updates stored objects.

An object not yet stored in the ObjectContainer will be stored when it is passed to set().



Method Detail
activate
public void activate(Object obj, int depth) throws IOException(Code)
Activates all members on a stored object to the specified depth.


throws:
  IOException -



close
public boolean close() throws IOException(Code)
closes the ObjectContainer.

A call to close() automatically performs a ObjectContainer.commit commit() .

Every session opened with JODB.openFile() requires one close()call, even if the same filename was used multiple times.

Use while(!close()){} to close all sessions using this container.

success - true denotes that the last used instance of this containerand the database file were closed.
throws:
  IOException -



commit
public void commit() throws IOException(Code)
Commits the running transaction.
throws:
  IOException -



deactivate
public void deactivate(Object obj, int depth)(Code)
deactivates a stored object by setting all members to NULL.
Primitive types will be set to their default values. The method has no effect, if the passed object is not stored in the ObjectContainer


Parameters:
  obj - the object to be deactivated.
Parameters:
  depth - the member to which deactivate is to cascade.



delete
public void delete(Object obj) throws IOException(Code)
deletes a stored object permanently.

Note that this method has to be called for every single object individually. Delete does not recurse to object members. Simple and array member types are destroyed. The method has no effect, if the passed object is not stored in the ObjectContainer. which can be also used for cascaded deletes.


Parameters:
  obj - the object to be deleted from theObjectContainer.

throws:
  IOException -



get
public ObjectSet<T> get(Object template) throws IOException, IllegalClassTypeException(Code)
Query-By-Example interface to retrieve objects.

get() creates an ObjectSet ObjectSet containing all objects in the ObjectContainer that match the passed template object.

Calling get(NULL) returns all objects stored in the ObjectContainer.


Query Evaluation
All non-null members of the template object are compared against all stored objects of the same class. Primitive type members are ignored if they are 0 or false respectively.

Returned Objects
The objects returned in the ObjectSet ObjectSet are instantiated and activated to the preconfigured depth. The com.mobixess.jodb.core.JODBConfig.getDefaultActivationDepth activation depth may be configured globally via com.mobixess.jodb.core.JODBConfig.setDefaultActivationDepth .

The database keeps track of all instantiatied objects. Queries will return references to these objects instead of instantiating them a second time.


Parameters:
  template - object to be used as an example to find all matching objects.

ObjectSet ObjectSet containing all found objects.


throws:
  IOException -
throws:
  IllegalClassTypeException -



query
public Query query()(Code)
creates a new S.O.D.A. Query Query .

Use ObjectContainer.get get(Object template) for simple Query-By-Example.



a new Query object



query
public ObjectSet<Type> query(Class<Type> clazz) throws IOException, IllegalClassTypeException(Code)
queries for all instances of a class.
Parameters:
  clazz - the class to query for. the ObjectSet returned by the query.
throws:
  IOException -
throws:
  IllegalClassTypeException -



rollback
public void rollback()(Code)
rolls back the running transaction.

Modified application objects im memory are not restored. Use combined calls to ObjectContainer.deactivate deactivate() and ObjectContainer.activate activate() to reload an objects member values.



set
public void set(Object obj) throws IllegalClassTypeException, IOException(Code)
Newly stores objects or updates stored objects.

An object not yet stored in the ObjectContainer will be stored when it is passed to set(). An object already stored in the ObjectContainer will be updated.
Parameters:
  obj - the object to be stored or updated.
throws:
  IOException - {@link IllegalClassTypeException}



set
public void set(Object obj, int depth) throws IllegalClassTypeException, IOException(Code)
Newly stores objects or updates stored objects.

An object not yet stored in the ObjectContainer will be stored when it is passed to set(). An object already stored in the ObjectContainer will be updated.
Parameters:
  obj - the object to be stored or updated.
Parameters:
  depth - the depth to which the object is to be updated
throws:
  IllegalClassTypeException -
throws:
  IOException -



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