Java Doc for ObjectClass.java in  » Database-DBMS » db4o-6.4 » com » db4o » config » 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 » db4o 6.4 » com.db4o.config 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.db4o.config.ObjectClass

All known Subclasses:   com.db4o.internal.Config4Class,
ObjectClass
public interface ObjectClass (Code)
configuration interface for classes.

Use the global Configuration object to configure db4o before opening an com.db4o.ObjectContainer ObjectContainer .

Example:
Configuration config = Db4o.configure();
ObjectClass oc = config.objectClass("package.className");
oc.updateDepth(3);
oc.minimumActivationDepth(3);




Method Summary
public  voidcallConstructor(boolean flag)
     advises db4o to try instantiating objects of this class with/without calling constructors.

Not all JDKs / .NET-environments support this feature.
public  voidcascadeOnActivate(boolean flag)
     sets cascaded activation behaviour.

Setting cascadeOnActivate to true will result in the activation of all member objects if an instance of this class is activated.

The default setting is false.

In client-server environment this setting should be used on both client and server.
public  voidcascadeOnDelete(boolean flag)
     sets cascaded delete behaviour.

Setting cascadeOnDelete to true will result in the deletion of all member objects of instances of this class, if they are passed to com.db4o.ObjectContainer.delete(Object) .
public  voidcascadeOnUpdate(boolean flag)
     sets cascaded update behaviour.

Setting cascadeOnUpdate to true will result in the update of all member objects if a stored instance of this class is passed to com.db4o.ObjectContainer.set(Object) .

The default setting is false.

In client-server environment this setting should be used on both client and server.
public  voidcompare(ObjectAttribute attributeProvider)
     registers an attribute provider for special query behavior.

The query processor will compare the object returned by the attribute provider instead of the actual object, both for the constraint and the candidate persistent object.

In client-server environment this setting should be used on both client and server.
public  voidenableReplication(boolean setting)
     Must be called before databases are created or opened so that db4o will control versions and generate UUIDs for objects of this class, which is required for using replication.
public  voidgenerateUUIDs(boolean setting)
     generate UUIDs for stored objects of this class.
public  voidgenerateVersionNumbers(boolean setting)
     generate version numbers for stored objects of this class.
public  voidindexed(boolean flag)
     turns the class index on or off.

db4o maintains an index for each class to be able to deliver all instances of a class in a query.
public  voidmaximumActivationDepth(int depth)
     sets the maximum activation depth to the desired value.

A class specific setting overrides the Configuration.activationDepth(int) global setting

In client-server environment this setting should be used on both client and server.
public  voidminimumActivationDepth(int depth)
     sets the minimum activation depth to the desired value.

A class specific setting overrides the Configuration.activationDepth(int) global setting

In client-server environment this setting should be used on both client and server.
public  intminimumActivationDepth()
     gets the configured minimum activation depth. In client-server environment this setting should be used on both client and server.
public  ObjectFieldobjectField(String fieldName)
     returns an ObjectField ObjectField object to configure the specified field.
public  voidpersistStaticFieldValues()
     turns on storing static field values for this class.

By default, static field values of classes are not stored to the database file.
public  voidreadAs(Object clazz)
     creates a temporary mapping of a persistent class to a different class.

If meta information for this ObjectClass has been stored to the database file, it will be read from the database file as if it was representing the class specified by the clazz parameter passed to this method.
public  voidrename(String newName)
     renames a stored class.

Use this method to refactor classes.

In client-server environment this setting should be used on both client and server.
public  voidstoreTransientFields(boolean flag)
     allows to specify if transient fields are to be stored.
The default for every class is false.

In client-server environment this setting should be used on both client and server.
public  voidtranslate(ObjectTranslator translator)
     registers a translator for this class.



The use of an ObjectTranslator ObjectTranslator is not compatible with the use of an internal class ObjectMarshaller.

In client-server environment this setting should be used on both client and server.
public  voidupdateDepth(int depth)
     specifies the updateDepth for this class.

see the documentation of com.db4o.ObjectContainer.set(Object) for further details.

The default setting is 0: Only the object passed to com.db4o.ObjectContainer.set(Object) will be updated.

In client-server environment this setting should be used on both client and server.



Method Detail
callConstructor
public void callConstructor(boolean flag)(Code)
advises db4o to try instantiating objects of this class with/without calling constructors.

Not all JDKs / .NET-environments support this feature. db4o will attempt, to follow the setting as good as the enviroment supports. In doing so, it may call implementation-specific features like sun.reflect.ReflectionFactory#newConstructorForSerialization on the Sun Java 1.4.x/5 VM (not available on other VMs) and FormatterServices.GetUninitializedObject() on the .NET framework (not available on CompactFramework).

This setting may also be set globally for all classes in Configuration.callConstructors(boolean) .

In client-server environment this setting should be used on both client and server.


Parameters:
  flag - - specify true, to request calling constructors, specifyfalse to request not calling constructors.
See Also:   Configuration.callConstructors



cascadeOnActivate
public void cascadeOnActivate(boolean flag)(Code)
sets cascaded activation behaviour.

Setting cascadeOnActivate to true will result in the activation of all member objects if an instance of this class is activated.

The default setting is false.

In client-server environment this setting should be used on both client and server.


Parameters:
  flag - whether activation is to be cascaded to member objects.
See Also:   ObjectField.cascadeOnActivate
See Also:   com.db4o.ObjectContainer.activate
See Also:   com.db4o.ext.ObjectCallbacks
See Also:    Using callbacks
See Also:   Configuration.activationDepth
See Also:    Why activation?



cascadeOnDelete
public void cascadeOnDelete(boolean flag)(Code)
sets cascaded delete behaviour.

Setting cascadeOnDelete to true will result in the deletion of all member objects of instances of this class, if they are passed to com.db4o.ObjectContainer.delete(Object) .

Caution !
This setting will also trigger deletion of old member objects, on calls to com.db4o.ObjectContainer.set(Object) .

An example of the behaviour:
ObjectContainer con;
Bar bar1 = new Bar();
Bar bar2 = new Bar();
foo.bar = bar1;
con.set(foo); // bar1 is stored as a member of foo
foo.bar = bar2;
con.set(foo); // bar2 is stored as a member of foo

The last statement will also delete bar1 from the ObjectContainer, no matter how many other stored objects hold references to bar1.

The default setting is false.

In client-server environment this setting should be used on both client and server.


Parameters:
  flag - whether deletes are to be cascaded to member objects.
See Also:   ObjectField.cascadeOnDelete
See Also:   com.db4o.ObjectContainer.delete
See Also:   com.db4o.ext.ObjectCallbacks
See Also:    Using callbacks



cascadeOnUpdate
public void cascadeOnUpdate(boolean flag)(Code)
sets cascaded update behaviour.

Setting cascadeOnUpdate to true will result in the update of all member objects if a stored instance of this class is passed to com.db4o.ObjectContainer.set(Object) .

The default setting is false.

In client-server environment this setting should be used on both client and server.


Parameters:
  flag - whether updates are to be cascaded to member objects.
See Also:   ObjectField.cascadeOnUpdate
See Also:   com.db4o.ObjectContainer.set
See Also:   com.db4o.ext.ObjectCallbacks
See Also:    Using callbacks



compare
public void compare(ObjectAttribute attributeProvider)(Code)
registers an attribute provider for special query behavior.

The query processor will compare the object returned by the attribute provider instead of the actual object, both for the constraint and the candidate persistent object.

In client-server environment this setting should be used on both client and server.


Parameters:
  attributeProvider - the attribute provider to be used



enableReplication
public void enableReplication(boolean setting)(Code)
Must be called before databases are created or opened so that db4o will control versions and generate UUIDs for objects of this class, which is required for using replication.
Parameters:
  setting -



generateUUIDs
public void generateUUIDs(boolean setting)(Code)
generate UUIDs for stored objects of this class. This setting should be used before the database is first created.


Parameters:
  setting -



generateVersionNumbers
public void generateVersionNumbers(boolean setting)(Code)
generate version numbers for stored objects of this class. This setting should be used before the database is first created.


Parameters:
  setting -



indexed
public void indexed(boolean flag)(Code)
turns the class index on or off.

db4o maintains an index for each class to be able to deliver all instances of a class in a query. If the class index is never needed, it can be turned off with this method to improve the performance to create and delete objects of a class.

Common cases where a class index is not needed:
- The application always works with subclasses or superclasses.
- There are convenient field indexes that will always find instances of a class.
- The application always works with IDs.

In client-server environment this setting should be used on both client and server.




maximumActivationDepth
public void maximumActivationDepth(int depth)(Code)
sets the maximum activation depth to the desired value.

A class specific setting overrides the Configuration.activationDepth(int) global setting

In client-server environment this setting should be used on both client and server.


Parameters:
  depth - the desired maximum activation depth
See Also:   Configuration.activationDepth
See Also:    Why activation?
See Also:   ObjectClass.cascadeOnActivate



minimumActivationDepth
public void minimumActivationDepth(int depth)(Code)
sets the minimum activation depth to the desired value.

A class specific setting overrides the Configuration.activationDepth(int) global setting

In client-server environment this setting should be used on both client and server.


Parameters:
  depth - the desired minimum activation depth
See Also:   Configuration.activationDepth
See Also:    Why activation?
See Also:   ObjectClass.cascadeOnActivate



minimumActivationDepth
public int minimumActivationDepth()(Code)
gets the configured minimum activation depth. In client-server environment this setting should be used on both client and server.

the configured minimum activation depth.



objectField
public ObjectField objectField(String fieldName)(Code)
returns an ObjectField ObjectField object to configure the specified field.


Parameters:
  fieldName - the fieldname of the field to be configured.

an instance of an ObjectField ObjectFieldobject for configuration.



persistStaticFieldValues
public void persistStaticFieldValues()(Code)
turns on storing static field values for this class.

By default, static field values of classes are not stored to the database file. By turning the setting on for a specific class with this switch, all non-simple-typed static field values of this class are stored the first time an object of the class is stored, and restored, every time a database file is opened afterwards, after class meta information is loaded for this class (which can happen by querying for a class or by loading an instance of a class).

To update a static field value, once it is stored, you have to the following in this order:
(1) open the database file you are working agains
(2) make sure the class metadata is loaded
objectContainer.query().constrain(Foo.class); // Java
objectContainer.Query().Constrain(typeof(Foo)); // C#
(3) change the static member
(4) store the static member explicitely
objectContainer.set(Foo.staticMember); // C#

The setting will be ignored for simple types.

Use this setting for constant static object members.

This option will slow down the process of opening database files and the stored objects will occupy space in the database file.

In client-server environment this setting should be used on both client and server.




readAs
public void readAs(Object clazz)(Code)
creates a temporary mapping of a persistent class to a different class.

If meta information for this ObjectClass has been stored to the database file, it will be read from the database file as if it was representing the class specified by the clazz parameter passed to this method. The clazz parameter can be any of the following:
- a fully qualified classname as a String.
- a Class object.
- any other object to be used as a template.

This method will be ignored if the database file already contains meta information for clazz.
Parameters:
  clazz - class name, Class object, or example object.




rename
public void rename(String newName)(Code)
renames a stored class.

Use this method to refactor classes.

In client-server environment this setting should be used on both client and server.


Parameters:
  newName - the new fully qualified classname.



storeTransientFields
public void storeTransientFields(boolean flag)(Code)
allows to specify if transient fields are to be stored.
The default for every class is false.

In client-server environment this setting should be used on both client and server.


Parameters:
  flag - whether or not transient fields are to be stored.



translate
public void translate(ObjectTranslator translator)(Code)
registers a translator for this class.



The use of an ObjectTranslator ObjectTranslator is not compatible with the use of an internal class ObjectMarshaller.

In client-server environment this setting should be used on both client and server.


Parameters:
  translator - this may be an ObjectTranslator ObjectTranslatoror an ObjectConstructor ObjectConstructor
See Also:   ObjectTranslator
See Also:   ObjectConstructor



updateDepth
public void updateDepth(int depth)(Code)
specifies the updateDepth for this class.

see the documentation of com.db4o.ObjectContainer.set(Object) for further details.

The default setting is 0: Only the object passed to com.db4o.ObjectContainer.set(Object) will be updated.

In client-server environment this setting should be used on both client and server.


Parameters:
  depth - the depth of the desired update for this class.
See Also:   Configuration.updateDepth
See Also:   ObjectClass.cascadeOnUpdate
See Also:   ObjectField.cascadeOnUpdate
See Also:   com.db4o.ext.ObjectCallbacks
See Also:    Using callbacks



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