Java Doc for OID.java in  » Testing » PolePosition-0.20 » com » versant » core » common » 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 » Testing » PolePosition 0.20 » com.versant.core.common 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.versant.core.common.OID

All known Subclasses:   com.versant.core.common.GenericOID,  com.versant.core.common.NewObjectOID,
OID
public interface OID extends Comparable,FastExternalizable(Code)
This is an abstract base class for OID classes. Each PC class has its own implementation generated for it at runtime. These implementations have fast implementations of various methods in the base class designed for different data stores.

Implementations must define equals and hashcode so that OIDs for the same class heirachy with the same datastore or application identity are equal and have the same hashcode.

Some of the methods in this interface can be implemented by calling other methods. This is deliberate as a generated hyperdrive OID class can hardcode the return value and avoid having to dereference a field every time. Example: OID.getClassIndex() == OID.getClassMetaData().index.

This interface must not extend Externalizable. Subclasses except for NewObjectOID must implement Externalizable so they can be serialized using writeObject. NewObjectOID must be serialized using the FastExternalizable methods instead and this restriction enforces this (NotSerializable exception if it happens).




Method Summary
public  intcompareTo(Object o)
     The IBM VMs have a problem with unimplemented interface methods in classes so we need this.
public  OIDcopy()
     Return a copy of the oid.
public  voidcopyKeyFields(Object[] data)
     Populate this OID from the array of Objects supplied.
public  OIDfillFromIDObject(Object id)
     Fill this OID from the given id.
public  voidfillFromIDString(String idString, int index)
     Fill this OID from its toString.
public  voidfillFromPK(Object pk)
     Fill in this OID from an instance of the objectid-class for the heirachy.
public  intgetAvailableClassId()
     Get the classId from the available class meta data or -1 if this is an untyped OID.
public  ClassMetaDatagetAvailableClassMetaData()
     Get whatever meta data is currently available for our class.
public  OIDgetAvailableOID()
     If this is a real OID (i.e.
public  ClassMetaDatagetBaseClassMetaData()
     Get the meta data for the least derived class in our heirachy. This is getAvailableClassMetaData().top but this method can be hardcoded in a generated class.
public  intgetClassIndex()
     Return the index of our PC class in the meta data.
public  ClassMetaDatagetClassMetaData()
     Get the meta data for our class.
public  intgetIdentityType()
     Get the identity type of the class we are referencing.
public  longgetLongPrimaryKey()
     Return the primary key stored in this OID as an int.
public  OIDgetRealOID()
     If this is a real OID (i.e.
public  booleanisNew()
    
public  booleanisResolved()
     Do we know the actual class of the object we are referencing? An OID may be created from a reference to a base class.
public  voidpopulateObjectIdClassInstance(Object o)
     Populate an instance of the objectid-class for our class from this OID.
public  voidresolve(State state)
     Resolve this OID from the state.
public  voidsetLongPrimaryKey(long pk)
     Set the primary key stored in this OID as an int.
public  StringtoPkString()
     Encode the 'primary key' of this OID as a String.
public  StringtoSString()
     Encode the 'primary key' of this OID as a String.
public  StringtoStringImp()
     Get the toString of this OID even if it has not been resolved.



Method Detail
compareTo
public int compareTo(Object o)(Code)
The IBM VMs have a problem with unimplemented interface methods in classes so we need this.



copy
public OID copy()(Code)
Return a copy of the oid.



copyKeyFields
public void copyKeyFields(Object[] data)(Code)
Populate this OID from the array of Objects supplied. These will come from some sort of key generator (e.g. a JdbcKeyGenerator). This is used to construct OIDs for newly created objects. Note that data may contain extra garbage objects from previously usages.



fillFromIDObject
public OID fillFromIDObject(Object id)(Code)
Fill this OID from the given id. If objectIdClass is mapped then 'id' will be assumed to be a instance of the objectIdClass, else 'id' is assumed to be a 'pk' for a class with a single pk field.
Parameters:
  id -



fillFromIDString
public void fillFromIDString(String idString, int index)(Code)
Fill this OID from its toString. The classid will have already been parsed out with index indicating the first character after the separator.



fillFromPK
public void fillFromPK(Object pk)(Code)
Fill in this OID from an instance of the objectid-class for the heirachy.



getAvailableClassId
public int getAvailableClassId()(Code)
Get the classId from the available class meta data or -1 if this is an untyped OID.



getAvailableClassMetaData
public ClassMetaData getAvailableClassMetaData()(Code)
Get whatever meta data is currently available for our class. The actual class may be a subclass of this. This will return null for an untyped OID.



getAvailableOID
public OID getAvailableOID()(Code)
If this is a real OID (i.e. it has been assigned in the database) then return itself. Otherwise return the corresponding real OID or this if none has been allocated yet. This differs from OID.getRealOID() in that it always returns an OID reference even if this is a new OID and no real OID has been allocated.



getBaseClassMetaData
public ClassMetaData getBaseClassMetaData()(Code)
Get the meta data for the least derived class in our heirachy. This is getAvailableClassMetaData().top but this method can be hardcoded in a generated class. This will return null for an untyped OID.



getClassIndex
public int getClassIndex()(Code)
Return the index of our PC class in the meta data. This can be called on an unresolved OID and the actual class may be a subclass of the class for the returned index. This is getAvailableClassMetaData().index but this method can be hardcoded in a generated class.



getClassMetaData
public ClassMetaData getClassMetaData()(Code)
Get the meta data for our class. This will throw a RuntimeException if called on an unresolved or untyped OID.
See Also:   OID.isResolved
See Also:   OID.resolve



getIdentityType
public int getIdentityType()(Code)
Get the identity type of the class we are referencing. It is ok to call this for an unresolved OID as the identity type is the same for all classes in a heirachy.



getLongPrimaryKey
public long getLongPrimaryKey()(Code)
Return the primary key stored in this OID as an int. This will only be called for datastore identity classes.



getRealOID
public OID getRealOID()(Code)
If this is a real OID (i.e. it has been assigned in the database) then return itself. Otherwise return the corresponding real OID or null if none has been allocated yet.



isNew
public boolean isNew()(Code)
Is this an OID for a new object?



isResolved
public boolean isResolved()(Code)
Do we know the actual class of the object we are referencing? An OID may be created from a reference to a base class. The actual class of the object referenced might only be detirmined when its State is fetched from the store.
See Also:   OID.resolve



populateObjectIdClassInstance
public void populateObjectIdClassInstance(Object o)(Code)
Populate an instance of the objectid-class for our class from this OID. This must throw a JDOFatalInternalException if invoked on an OID for a datastore identity class.



resolve
public void resolve(State state)(Code)
Resolve this OID from the state. This will update our class index to reflect the state. It is a NOP to call this on an already resolved OID.
See Also:   OID.isResolved



setLongPrimaryKey
public void setLongPrimaryKey(long pk)(Code)
Set the primary key stored in this OID as an int. This will only be called for datastore identity classes.



toPkString
public String toPkString()(Code)
Encode the 'primary key' of this OID as a String. This is used for pretty printing OIDs in the workbench.



toSString
public String toSString()(Code)
Encode the 'primary key' of this OID as a String. This is used for debugging.



toStringImp
public String toStringImp()(Code)
Get the toString of this OID even if it has not been resolved.



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