Save This Page
Home » jdo2-model-2.3-ea-src » org.apache.jdo.model.jdo » [javadoc | source]
org.apache.jdo.model.jdo
public interface: JDOModel [javadoc | source]

All Implemented Interfaces:
    JDOElement

All Known Implementing Classes:
    JDOModelImplDynamic, JDOModelImplCaching

A JDOModel instance bundles a number of JDOClass instances used by an application. It provides factory methods to create and retrieve JDOClass instances. A fully qualified class name must be unique within a JDOModel instance. The model supports multiple classes having the same fully qualified name by different JDOModel instances.
Method from org.apache.jdo.model.jdo.JDOModel Summary:
createJDOClass,   createJDOClass,   createJDOPackage,   getDeclaredClasses,   getDeclaredPackages,   getJDOClass,   getJDOClass,   getJDOClassForObjectIdClass,   getJDOClassForShortName,   getJDOPackage,   getJavaModel,   getParent,   setJavaModel
Method from org.apache.jdo.model.jdo.JDOModel Detail:
 public JDOClass createJDOClass(String className) throws ModelException
    The method returns a JDOClass instance for the specified fully qualified class name. If this JDOModel contains the corresponding JDOClass instance, the existing instance is returned. Otherwise, it creates a new JDOClass instance, sets its declaringModel and returns the new instance.

    Whether this method reads XML metatdata or not is determined at JDOModel creation time (see flag loadXMLMetadataDefault in JDOModelFactory#getJDOModel(JavaModel javaModel, boolean loadXMLMetadataDefault) ). Invoking this method is method is equivalent to createJDOClass(className, loadXMLMetadataDefault).

 public JDOClass createJDOClass(String className,
    boolean loadXMLMetadata) throws ModelException
    The method returns a JDOClass instance for the specified fully qualified class name. If this JDOModel contains the corresponding JDOClass instance, the existing instance is returned. Otherwise, if the flag loadXMLMetadata is set to true the method tries to find the JDOClass instance by reading the XML metadata. If it could not be found the method creates a new JDOClass instance, sets its declaringModel and returns the instance.
 public JDOPackage createJDOPackage(String packageName) throws ModelException
    The method returns a JDOClass instance for the specified package name. If this JDOModel contains the corresponding JDOPackage instance, the existing instance is returned. Otherwise, it creates a new JDOPackage instance and returns the new instance.
 public JDOClass[] getDeclaredClasses()
    Returns the collection of JDOClass instances declared by this JDOModel in the format of an array.
 public JDOPackage[] getDeclaredPackages()
    Returns the collection of JDOPackage instances declared by this JDOModel in the format of an array.
 public JDOClass getJDOClass(String className)
    The method returns the JDOClass instance for the specified fully qualified class name if present. The method returns null if it cannot find a JDOClass instance for the specified name.

    Whether this method reads XML metatdata or not is determined at JDOModel creation time (see flag loadXMLMetadataDefault in JDOModelFactory#getJDOModel(JavaModel javaModel, boolean loadXMLMetadataDefault) ). Invoking this method is method is equivalent to createJDOClass(className, loadXMLMetadataDefault).

 public JDOClass getJDOClass(String className,
    boolean loadXMLMetadata)
    The method returns the JDOClass instance for the specified fully qualified class name if present. If the flag loadXMLMetadata is set to true the method tries to find the JDOClass instance by reading the XML metadata. The method returns null if it cannot find a JDOClass instance for the specified name.
 public JDOClass getJDOClassForObjectIdClass(JavaType objectIdClass)
    This method returns the JDOClass instance that defines the specified type as its objectId class. In the case of an inheritance hierarchy it returns the top most persistence-capable class of the hierarchy (see JDOClass#getPersistenceCapableSuperclass ).
 public JDOClass getJDOClassForShortName(String shortName)
 public JDOPackage getJDOPackage(String packageName)
    The method returns the JDOPackage instance for the specified package name, if present. The method returns null if it cannot find a JDOPackage instance for the specified name.
 public JavaModel getJavaModel()
    Returns the JavaModel bound to this JDOModel instance.
 public JDOModel getParent()
    Returns the parent JDOModel instance of this JDOModel.
 public  void setJavaModel(JavaModel javaModel)
    Sets the JavaModel for this JDOModel instance.