Java Doc for OTMConnection.java in  » Database-ORM » db-ojb » org » apache » ojb » otm » 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.otm 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.ojb.otm.OTMConnection

All known Subclasses:   org.apache.ojb.otm.core.BaseConnection,  org.apache.ojb.otm.connector.OTMJCAConnection,
OTMConnection
public interface OTMConnection (Code)
A OTMConnection within the given Environment
author:
   Raghu Rajah




Method Summary
 voidclose()
    
public  voiddeletePersistent(Object obj)
     Mark the given object for deletion from the persistent store.
public  CollectiongetCollectionByQuery(Query query, int lock)
    
Parameters:
  query - The query to execute
Parameters:
  lock - the lock that need to be acquired on the objectPossible values are:LockType.NO_LOCK (aka read only) - changes to the object will not be written to database;LockType.READ_LOCK (aka optimistic lock) - changes to the object will be written to the database,in this case the lock will be automatically upgraded to the write lock on transaction commit;LockType.WRITE_LOCK (aka pessimistic lock) - changes to the object will be written to the database.
public  CollectiongetCollectionByQuery(Query query)
    
Parameters:
  query - The query to execute an Iterator that iterates Objects of class c if calling the .next()method.
 intgetCount(Query query)
    
public  ClassDescriptorgetDescriptorFor(Class clazz)
    
public  EditingContextgetEditingContext()
     Get the EditingContext associated with the transaction to which this connection belongs.
public  IdentitygetIdentity(Object object)
    
public  IteratorgetIteratorByOQLQuery(OQLQuery query)
    
Parameters:
  query - The OQL query to execute an Iterator that iterates Objects of class c if calling the .next()method.
public  IteratorgetIteratorByOQLQuery(OQLQuery query, int lock)
    
Parameters:
  query - The OQL query to execute
Parameters:
  lock - the lock that need to be acquired on the objectPossible values are:LockType.NO_LOCK (aka read only) - changes to the object will not be written to database;LockType.READ_LOCK (aka optimistic lock) - changes to the object will be written to the database,in this case the lock will be automatically upgraded to the write lock on transaction commit;LockType.WRITE_LOCK (aka pessimistic lock) - changes to the object will be written to the database.
public  IteratorgetIteratorByQuery(Query query)
    
Parameters:
  query - The query to execute an Iterator that iterates Objects of class c if calling the .next()method.
public  IteratorgetIteratorByQuery(Query query, int lock)
    
Parameters:
  query - The query to execute
Parameters:
  lock - the lock that need to be acquired on the objectPossible values are:LockType.NO_LOCK (aka read only) - changes to the object will not be written to database;LockType.READ_LOCK (aka optimistic lock) - changes to the object will be written to the database,in this case the lock will be automatically upgraded to the write lock on transaction commit;LockType.WRITE_LOCK (aka pessimistic lock) - changes to the object will be written to the database.
public  ObjectgetObjectByIdentity(Identity oid)
     Get the object with the given Identity from the persistent store.
public  ObjectgetObjectByIdentity(Identity oid, int lock)
     Get the object with the given Identity from the persistent store with the given lock value.
Parameters:
  oid - the Identity of the object to fetch
Parameters:
  lock - the lock that need to be acquired on the objectPossible values are:LockType.NO_LOCK (aka read only) - changes to the object will not be written to database;LockType.READ_LOCK (aka optimistic lock) - changes to the object will be written to the database,in this case the lock will be automatically upgraded to the write lock on transaction commit;LockType.WRITE_LOCK (aka pessimistic lock) - changes to the object will be written to the database.
public  TransactiongetTransaction()
    
public  voidinvalidate(Identity oid)
     In the case if the program need to change the objects via direct JDBC call, it should first call invalidate() for the object, which will lock the object for write and tell OJB OTM that it must be re-read from the database, only after that you shold perform JDBC operation.
public  voidinvalidateAll()
    
 booleanisClosed()
    
public  voidlockForWrite(Object object)
     Lock the given object for Write.
public  voidmakePersistent(Object object)
     Make the given object persistent by inserting it into the database.
public  EnhancedOQLQuerynewOQLQuery()
     returns a new OQL Query.
public  EnhancedOQLQuerynewOQLQuery(int lock)
     returns a new OQL Query.
 voidrefresh(Object object)
     Updates the values in the object from the data in data store.
 ObjectCacheserviceObjectCache()
    
public  voidsetTransaction(Transaction tx)
     Associate this connection with a given transaction.



Method Detail
close
void close()(Code)
Close the OTMConnection



deletePersistent
public void deletePersistent(Object obj) throws LockingException(Code)
Mark the given object for deletion from the persistent store. The object would then become a transient object, rather than a persistent one.
Parameters:
  obj - the object to delete



getCollectionByQuery
public Collection getCollectionByQuery(Query query, int lock)(Code)

Parameters:
  query - The query to execute
Parameters:
  lock - the lock that need to be acquired on the objectPossible values are:LockType.NO_LOCK (aka read only) - changes to the object will not be written to database;LockType.READ_LOCK (aka optimistic lock) - changes to the object will be written to the database,in this case the lock will be automatically upgraded to the write lock on transaction commit;LockType.WRITE_LOCK (aka pessimistic lock) - changes to the object will be written to the database. an Iterator that iterates Objects of class c if calling the .next()method. The returned objects are locked with the given lock value.



getCollectionByQuery
public Collection getCollectionByQuery(Query query)(Code)

Parameters:
  query - The query to execute an Iterator that iterates Objects of class c if calling the .next()method. The returned objects are locked for read.



getCount
int getCount(Query query)(Code)
return the number of objects that would be returned from this query
Parameters:
  query - the number of objects that would be returned from this query



getDescriptorFor
public ClassDescriptor getDescriptorFor(Class clazz)(Code)



getEditingContext
public EditingContext getEditingContext()(Code)
Get the EditingContext associated with the transaction to which this connection belongs. EditingContext contains and manages the set of objects read/edited within the current transaction. EditingContext associated with current Transaction



getIdentity
public Identity getIdentity(Object object)(Code)
Get the identity of the object
Parameters:
  object - The object the identity of the object



getIteratorByOQLQuery
public Iterator getIteratorByOQLQuery(OQLQuery query)(Code)

Parameters:
  query - The OQL query to execute an Iterator that iterates Objects of class c if calling the .next()method. The returned objects are locked for read.



getIteratorByOQLQuery
public Iterator getIteratorByOQLQuery(OQLQuery query, int lock)(Code)

Parameters:
  query - The OQL query to execute
Parameters:
  lock - the lock that need to be acquired on the objectPossible values are:LockType.NO_LOCK (aka read only) - changes to the object will not be written to database;LockType.READ_LOCK (aka optimistic lock) - changes to the object will be written to the database,in this case the lock will be automatically upgraded to the write lock on transaction commit;LockType.WRITE_LOCK (aka pessimistic lock) - changes to the object will be written to the database. an Iterator that iterates Objects of class c if calling the .next()method. The returned objects are locked for read.



getIteratorByQuery
public Iterator getIteratorByQuery(Query query)(Code)

Parameters:
  query - The query to execute an Iterator that iterates Objects of class c if calling the .next()method. The returned objects are locked for read.



getIteratorByQuery
public Iterator getIteratorByQuery(Query query, int lock)(Code)

Parameters:
  query - The query to execute
Parameters:
  lock - the lock that need to be acquired on the objectPossible values are:LockType.NO_LOCK (aka read only) - changes to the object will not be written to database;LockType.READ_LOCK (aka optimistic lock) - changes to the object will be written to the database,in this case the lock will be automatically upgraded to the write lock on transaction commit;LockType.WRITE_LOCK (aka pessimistic lock) - changes to the object will be written to the database. an Iterator that iterates Objects of class c if calling the .next()method. The returned objects are locked with the given lock value.



getObjectByIdentity
public Object getObjectByIdentity(Identity oid) throws LockingException(Code)
Get the object with the given Identity from the persistent store. By default, the fetch is for read. (OTM will automatically lock it for write on transaction commit if the object will appear to be modified).
Parameters:
  oid - the Identity of the object to fetch the object from the persistent store.
throws:
  LockingException - thrown by the LockManager to avoid deadlocks. The fetch could bere-submitted.



getObjectByIdentity
public Object getObjectByIdentity(Identity oid, int lock) throws LockingException(Code)
Get the object with the given Identity from the persistent store with the given lock value.
Parameters:
  oid - the Identity of the object to fetch
Parameters:
  lock - the lock that need to be acquired on the objectPossible values are:LockType.NO_LOCK (aka read only) - changes to the object will not be written to database;LockType.READ_LOCK (aka optimistic lock) - changes to the object will be written to the database,in this case the lock will be automatically upgraded to the write lock on transaction commit;LockType.WRITE_LOCK (aka pessimistic lock) - changes to the object will be written to the database. the object from the persistent store.
throws:
  LockingException - thrown by the LockManager to avoid a deadlock.



getTransaction
public Transaction getTransaction()(Code)
Obtain the Transaction this connection is associated with



invalidate
public void invalidate(Identity oid) throws LockingException(Code)
In the case if the program need to change the objects via direct JDBC call, it should first call invalidate() for the object, which will lock the object for write and tell OJB OTM that it must be re-read from the database, only after that you shold perform JDBC operation. NOTE: it is not recommended to use read-uncommitted isolation if you want this feature to work correctly.



invalidateAll
public void invalidateAll() throws LockingException(Code)
clear the underlying caches



isClosed
boolean isClosed()(Code)
check if the OTMConnection is closed



lockForWrite
public void lockForWrite(Object object) throws LockingException(Code)
Lock the given object for Write. Only write locked objects are persisted back to the database. Changes to read objects are not inserted back into the database.
Parameters:
  object - the object to be locked for write.



makePersistent
public void makePersistent(Object object) throws LockingException(Code)
Make the given object persistent by inserting it into the database. Also read locks the object (OTM will automatically lock it for write on transaction commit if the object will appear to be modified).
Parameters:
  object - the object to be made persistent



newOQLQuery
public EnhancedOQLQuery newOQLQuery()(Code)
returns a new OQL Query. This OQL query is Enhanced, meaning it does the ODMG functionality as well as some additional OJB specific, non portable functionality. the new OQLQuery



newOQLQuery
public EnhancedOQLQuery newOQLQuery(int lock)(Code)
returns a new OQL Query. This OQL query is Enhanced, meaning it does the ODMG functionality as well as some additional OJB specific, non portable functionality.
Parameters:
  lock - the lock that need to be acquired on the objectPossible values are:LockType.NO_LOCK (aka read only) - changes to the object will not be written to database;LockType.READ_LOCK (aka optimistic lock) - changes to the object will be written to the database,in this case the lock will be automatically upgraded to the write lock on transaction commit;LockType.WRITE_LOCK (aka pessimistic lock) - changes to the object will be written to the database. the new OQLQuery



refresh
void refresh(Object object)(Code)
Updates the values in the object from the data in data store. The state of the object becomes "Persistent-clean".



serviceObjectCache
ObjectCache serviceObjectCache()(Code)
get the global cache



setTransaction
public void setTransaction(Transaction tx)(Code)
Associate this connection with a given transaction.



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