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


java.lang.Object
   org.apache.ojb.broker.Identity

Identity
public class Identity implements Serializable(Code)
Represents the identity of an object.
It's composed of:
  • class of the real object
  • top-level class of the real object (could be an abstract class or interface or the class of the object itself), used to make an object unique across extent classes
  • an array of all primary key value objects
  • a flag which indicates whether this is a transient Identity (identity of a non-persistent, "new" object) or a persistent Identity (identity object of a persistent, "already written to datastore" object).

To create Identity objects it's strongly recommended to use the IdentityFactory , because in future releases of OJB the Identity constructors will be no longer reachable or forbidden to use.

NOTE: An Identity object must be unique accross extents. Means all objects with the same top-level class need unique PK values.


See Also:   org.apache.ojb.broker.IdentityFactory
author:
   Thomas Mahler
version:
   $Id: Identity.java,v 1.36.2.14 2005/12/21 22:22:07 tomdz Exp $



Constructor Summary
protected  Identity()
    
public  Identity(Class realClass, Class topLevel, Object[] pkValues, boolean isTransient)
     For internal use only!.
public  Identity(Class realClass, Class topLevel, Object[] pkValues)
     For internal use only! Creates an Identity from a class and the objects primary key values.
public  Identity(Object objectToIdentitify, PersistenceBroker targetBroker)
     Constructor for internal use.
public  Identity(Object objectToIdentitify, PersistenceBroker targetBroker, ClassDescriptor cld)
     Constructor for internal use.

Method Summary
protected  voidcheckForPrimaryKeys(Object realObject)
     OJB can handle only classes that declare at least one primary key attribute, this method checks this condition.
public  booleanequals(Object obj)
    
public static  IdentityfromByteArray(byte[] anArray)
     Factory method that returns an Identity object created from a serializated representation.
public  ClassgetObjectsRealClass()
     Return the "real" class of the real subject.
public  ClassgetObjectsTopLevelClass()
     Returns the top-level class of the real subject (base class, base interface denoted in the repository or objects real class if no top-level was found).
public  Object[]getPrimaryKeyValues()
     Returns the primary key values of the real subject.
public  inthashCode()
    
public  booleanisTransient()
     Determines whether the identity is transient.
public  byte[]serialize()
     Return the serialized form of this Identity.
public  voidsetObjectsRealClass(Class objectsRealClass)
     Set the real class of the subject.
public  StringtoString()
     return a String representation.


Constructor Detail
Identity
protected Identity()(Code)
For internal use only!



Identity
public Identity(Class realClass, Class topLevel, Object[] pkValues, boolean isTransient)(Code)
For internal use only!. Creates an em from a class and the objects primary key values. used for the definition of proxies.
OJB user have to use IdentityFactory to create object identity.
Parameters:
  realClass - the concrete class of the object, or null if not known.
Parameters:
  topLevel - the highest persistence-capable class orinterface (in the inheritance hierarchy) that the identified object is an instance of
Parameters:
  pkValues - (unique across the extents !)
Parameters:
  isTransient - If true



Identity
public Identity(Class realClass, Class topLevel, Object[] pkValues)(Code)
For internal use only! Creates an Identity from a class and the objects primary key values. used for the definition of proxies.
OJB user have to use IdentityFactory to create object identity.
Parameters:
  realClass - the concrete class of the object, or null if not known.
Parameters:
  topLevel - the highest persistence-capable class orinterface (in the inheritance hierarchy) that the identified object is an instance of
Parameters:
  pkValues - (unique across the extents !)



Identity
public Identity(Object objectToIdentitify, PersistenceBroker targetBroker)(Code)
Constructor for internal use. Use IdentityFactory to create an object identity.
Parameters:
  objectToIdentitify - The object for which to create the identity
Parameters:
  targetBroker - The persistence broker



Identity
public Identity(Object objectToIdentitify, PersistenceBroker targetBroker, ClassDescriptor cld)(Code)
Constructor for internal use. Use IdentityFactory to create an object identity.
Parameters:
  objectToIdentitify - The object for which to create the identity
Parameters:
  targetBroker - The persistence broker
Parameters:
  cld - The class descriptor




Method Detail
checkForPrimaryKeys
protected void checkForPrimaryKeys(Object realObject) throws ClassNotPersistenceCapableException(Code)
OJB can handle only classes that declare at least one primary key attribute, this method checks this condition.
Parameters:
  realObject - The real object to check
throws:
  ClassNotPersistenceCapableException - thrown if no primary key is specified for the objects class



equals
public boolean equals(Object obj)(Code)



fromByteArray
public static Identity fromByteArray(byte[] anArray) throws PersistenceBrokerException(Code)
Factory method that returns an Identity object created from a serializated representation.
Parameters:
  anArray - The serialized representation The identity
See Also:    Identity.serialize
See Also:   .



getObjectsRealClass
public Class getObjectsRealClass()(Code)
Return the "real" class of the real subject. The real class



getObjectsTopLevelClass
public Class getObjectsTopLevelClass()(Code)
Returns the top-level class of the real subject (base class, base interface denoted in the repository or objects real class if no top-level was found). The top level class



getPrimaryKeyValues
public Object[] getPrimaryKeyValues()(Code)
Returns the primary key values of the real subject. The pk values



hashCode
public int hashCode()(Code)



isTransient
public boolean isTransient()(Code)
Determines whether the identity is transient. true if the identity is transient



serialize
public byte[] serialize() throws PersistenceBrokerException(Code)
Return the serialized form of this Identity. The serialized representation
See Also:   Identity.fromByteArray



setObjectsRealClass
public void setObjectsRealClass(Class objectsRealClass)(Code)
Set the real class of the subject.
Parameters:
  objectsRealClass - The real class



toString
public String toString()(Code)
return a String representation. java.lang.String



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.