Java Doc for EntityModel.java in  » JMX » je » com » sleepycat » persist » model » 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 » JMX » je » com.sleepycat.persist.model 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sleepycat.persist.model.EntityModel

All known Subclasses:   com.sleepycat.persist.model.AnnotationModel,  com.sleepycat.persist.impl.StoredModel,
EntityModel
abstract public class EntityModel (Code)
The base class for classes that provide entity model metadata. An EntityModel defines entity classes, primary keys, secondary keys, and relationships between entities. For each entity class that is part of the model, a single PrimaryIndex object and zero or more SecondaryIndex objects may be accessed via an EntityStore .

The built-in entity model, the AnnotationModel , is based on annotations that are added to entity classes and their key fields. Annotations are used in the examples in this package, and it is expected that annotations will normally be used; most readers should therefore skip to the AnnotationModel class. However, a custom entity model class may define its own metadata. This can be used to define entity classes and keys using mechanisms other than annotations.

A concrete entity model class should extend this class and implement the EntityModel.getClassMetadata , EntityModel.getEntityMetadata and EntityModel.getKnownClasses methods.

This is an abstract class rather than an interface to allow adding capabilities to the model at a future date without causing incompatibilities. For example, a method may be added in the future for returning new information about the model and subclasses may override this method to return the new information. Any new methods will have default implementations that return default values, and the use of the new information will be optional.


author:
   Mark Hayes



Constructor Summary
protected  EntityModel()
     The default constructor for use by subclasses.

Method Summary
public static  ClassclassForName(String className)
     Calls Class.forName with the current thread context class loader.
final public  ObjectconvertRawObject(RawObject raw)
     Converts a given raw object to a live object according to the current class definitions.
final public  List<RawType>getAllRawTypeVersions(String className)
     Returns all known versions of type information for a given class name, or null if no persistent version of the class is known.
Parameters:
  className - the name of the latest version of the class.
abstract public  ClassMetadatagetClassMetadata(String className)
     Returns the metadata for a given persistent class name, including proxy classes and entity classes.
abstract public  EntityMetadatagetEntityMetadata(String className)
     Returns the metadata for a given entity class name.
abstract public  Set<String>getKnownClasses()
     Returns the names of all known persistent classes.
final public  RawTypegetRawType(String className)
     Returns the type information for the current version of a given class, or null if the class is not currently persistent.
final public  RawTypegetRawTypeVersion(String className, int version)
     Returns the type information for a given version of a given class, or null if the given version of the class is unknown.
final public  booleanisOpen()
     Returns whether the model is associated with an open store.

The EntityModel.registerClass method may only be called when the model is not yet open.

final public  voidregisterClass(Class persistentClass)
     Registers a persistent class, most importantly, a PersistentProxy class.
 voidsetCatalog(PersistCatalog catalog)
     Gives this model access to the catalog, which is used for returning raw type information.


Constructor Detail
EntityModel
protected EntityModel()(Code)
The default constructor for use by subclasses.




Method Detail
classForName
public static Class classForName(String className) throws ClassNotFoundException(Code)
Calls Class.forName with the current thread context class loader. This method should be called by entity model implementations instead of calling Class.forName whenever loading an application class.



convertRawObject
final public Object convertRawObject(RawObject raw)(Code)
Converts a given raw object to a live object according to the current class definitions.

The given raw object must conform to the current class definitions. However, the raw type ( RawObject.getType ) is allowed to be from a different store, as long as the class names and the value types match. This allows converting raw objects that are read from one store to live objects in another store, for example, in a conversion program.




getAllRawTypeVersions
final public List<RawType> getAllRawTypeVersions(String className)(Code)
Returns all known versions of type information for a given class name, or null if no persistent version of the class is known.
Parameters:
  className - the name of the latest version of the class. an unmodifiable list of types for the given class name in orderfrom most recent to least recent.
throws:
  IllegalStateException - if this method is called for a model thatis not associated with an open store.



getClassMetadata
abstract public ClassMetadata getClassMetadata(String className)(Code)
Returns the metadata for a given persistent class name, including proxy classes and entity classes. the metadata or null if the class is not persistent or does notexist.



getEntityMetadata
abstract public EntityMetadata getEntityMetadata(String className)(Code)
Returns the metadata for a given entity class name. the metadata or null if the class is not an entity class or doesnot exist.



getKnownClasses
abstract public Set<String> getKnownClasses()(Code)
Returns the names of all known persistent classes. A type becomes known when an instance of the type is stored for the first time or metadata or type information is queried for a specific class name. an unmodifiable set of class names.
throws:
  IllegalStateException - if this method is called for a model thatis not associated with an open store.



getRawType
final public RawType getRawType(String className)(Code)
Returns the type information for the current version of a given class, or null if the class is not currently persistent.
Parameters:
  className - the name of the current version of the class.
throws:
  IllegalStateException - if this method is called for a model thatis not associated with an open store.



getRawTypeVersion
final public RawType getRawTypeVersion(String className, int version)(Code)
Returns the type information for a given version of a given class, or null if the given version of the class is unknown.
Parameters:
  className - the name of the latest version of the class.
Parameters:
  version - the desired version of the class.
throws:
  IllegalStateException - if this method is called for a model thatis not associated with an open store.
throws:
  IllegalStateException - if this method is called for a model thatis not associated with an open store.



isOpen
final public boolean isOpen()(Code)
Returns whether the model is associated with an open store.

The EntityModel.registerClass method may only be called when the model is not yet open. Certain other methods may only be called when the model is open:




registerClass
final public void registerClass(Class persistentClass)(Code)
Registers a persistent class, most importantly, a PersistentProxy class. Any persistent class may be registered in advance of using it, to avoid the overhead of updating the catalog database when an instance of the class is first stored. This method must be called to register PersistentProxy classes. This method must be called before opening a store based on this model.
throws:
  IllegalStateException - if this method is called for a model thatis associated with an open store.
throws:
  IllegalArgumentException - if the given class is not persistentor has a different class loader than previously registered classes.



setCatalog
void setCatalog(PersistCatalog catalog)(Code)
Gives this model access to the catalog, which is used for returning raw type information.



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.