com.sap.ip.me.api.persist.meta
Class DescriptorRuntime

java.lang.Object
  extended bycom.sap.ip.me.api.persist.meta.DescriptorRuntime

public abstract class DescriptorRuntime
extends java.lang.Object

Factory for AttributeDescriptor, ClassDescriptor, LinkDescriptor. Once created, ClassDescriptor are held internally and may be read again.

Author:
SAP
See Also:
AttributeDescriptor, ClassDescriptor, LinkDescriptor

Field Summary
static int MAX_ATTRIB_MULTIPLICITY
          Description of the Field
 
Constructor Summary
DescriptorRuntime()
           
 
Method Summary
abstract  boolean containsClassDescriptor(java.lang.String classtype)
          Checks if a ClassDescriptor instance has already been created for a classtype
abstract  AttributeDescriptor createAttributeDescriptor(java.lang.String name, AttributeType type, int mult, int length)
          Creates an instance of AttributeDescriptor.
abstract  AttributeDescriptor createAttributeDescriptor(java.lang.String name, AttributeType type, int mult, int length, boolean isIndex)
          Creates an instance of AttributeDescriptor.
abstract  AttributeDescriptor createAttributeDescriptor(java.lang.String name, AttributeType type, int mult, int length, int dec, boolean isIndex)
          Creates an instance of AttributeDescriptor.
abstract  ClassDescriptor createClassDescriptor(java.lang.String classtype, AttributeDescriptor[] attributes)
          Creates an instance of ClassDescriptor without links.
abstract  ClassDescriptor createClassDescriptor(java.lang.String classtype, AttributeDescriptor[] attributes, LinkDescriptor[] links)
          Creates an instance of ClassDescriptor.
abstract  ClassDescriptor createClassDescriptor(java.lang.String classtype, AttributeDescriptor[] atts, LinkDescriptor[] links, int keyLen)
          Creates an instance of ClassDescriptor.
abstract  ClassDescriptor createClassDescriptor(java.lang.String classtype, LinkDescriptor[] links)
          Deprecated. no usecase for this type
abstract  LinkDescriptor createLinkDescriptor(java.lang.String name, java.lang.String classtype, MultiplicityType multiplicity, boolean isDependent)
          Creates an instance of LinkDescriptor.
abstract  ClassDescriptor getClassDescriptor(java.lang.String classtype)
          Returns a ClassDescriptor instance for a defined classtype, if it is registered.
static DescriptorRuntime getInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_ATTRIB_MULTIPLICITY

public static final int MAX_ATTRIB_MULTIPLICITY
Description of the Field

See Also:
Constant Field Values
Constructor Detail

DescriptorRuntime

public DescriptorRuntime()
Method Detail

getInstance

public static final DescriptorRuntime getInstance()

createAttributeDescriptor

public abstract AttributeDescriptor createAttributeDescriptor(java.lang.String name,
                                                              AttributeType type,
                                                              int mult,
                                                              int length)
                                                       throws DescriptorException
Creates an instance of AttributeDescriptor. You should avoid creating attributes with multiplicity for best performance.

Parameters:
name - unique name
type - type of the Attribute
mult - multiplicity
length - maximum length
Returns:
instance of AttributeDescriptor
Throws:
DescriptorException

createAttributeDescriptor

public abstract AttributeDescriptor createAttributeDescriptor(java.lang.String name,
                                                              AttributeType type,
                                                              int mult,
                                                              int length,
                                                              int dec,
                                                              boolean isIndex)
                                                       throws DescriptorException
Creates an instance of AttributeDescriptor. You should avoid creating attributes with multiplicity for best performance.

Parameters:
name - unique name
type - type of the Attribute
mult - multiplicity
length - maximum length
dec - decimals for this attribute (only allowed for some types)
isIndex - mark Attribute as secondary index for query optimization
Returns:
instance of AttributeDescriptor
Throws:
DescriptorException

createAttributeDescriptor

public abstract AttributeDescriptor createAttributeDescriptor(java.lang.String name,
                                                              AttributeType type,
                                                              int mult,
                                                              int length,
                                                              boolean isIndex)
                                                       throws DescriptorException
Creates an instance of AttributeDescriptor. You should avoid creating attributes with multiplicity for best performance.

Parameters:
name - unique name
type - type of the Attribute
mult - multiplicity
length - maximum length
isIndex - mark Attribute as secondary index for query optimization
Returns:
instance of AttributeDescriptor
Throws:
DescriptorException

createLinkDescriptor

public abstract LinkDescriptor createLinkDescriptor(java.lang.String name,
                                                    java.lang.String classtype,
                                                    MultiplicityType multiplicity,
                                                    boolean isDependent)
                                             throws DescriptorException
Creates an instance of LinkDescriptor. You should completely avoid using multiple links for best performance!

Parameters:
name - unique identifier
classtype - type of the referenced class
multiplicity - SINGLE or MULTIPLE_VECTOR.
isDependent - mark as dependent for deep operations
Returns:
LinkDescriptor
Throws:
DescriptorException

createClassDescriptor

public abstract ClassDescriptor createClassDescriptor(java.lang.String classtype,
                                                      AttributeDescriptor[] attributes)
                                               throws DescriptorException
Creates an instance of ClassDescriptor without links. The classtype must be unique. An exception is thrown if a ClassDescriptor instance has already been created for an equal classtype. The AttributeDescriptor[] must not contain a Descriptor for the persistence key Attribute, as this will be generated by the framework (of AttributeType.STRING with a default length).

Parameters:
classtype - unique type key
attributes - all attributes contained in this class
Returns:
instance of ClassDescriptor
Throws:
DescriptorException

createClassDescriptor

public abstract ClassDescriptor createClassDescriptor(java.lang.String classtype,
                                                      LinkDescriptor[] links)
                                               throws DescriptorException
Deprecated. no usecase for this type

Creates an instance of ClassDescriptor. The classtype must be unique. An exception is thrown if a ClassDescriptor instance has already been created for an equal classtype. This method creates a ClassDescriptor without attributes.

Parameters:
classtype - unique type key
links - all links contained in this class
Returns:
instance of ClassDescriptor
Throws:
DescriptorException

createClassDescriptor

public abstract ClassDescriptor createClassDescriptor(java.lang.String classtype,
                                                      AttributeDescriptor[] atts,
                                                      LinkDescriptor[] links,
                                                      int keyLen)
                                               throws DescriptorException
Creates an instance of ClassDescriptor. The classtype must be unique. An exception is thrown if a ClassDescriptor instance has already been created for an equal classtype. Use multiple links with care, because they produce much overhead.

The AttributeDescriptor[] must not contain a Descriptor for the persistence key Attribute, as this will be generated by the framework (of AttributeType.STRING with the specified length).

Parameters:
classtype - unique type key
atts - all attributes contained in this class
links - all links contained in this class
Returns:
instance of ClassDescriptor
Throws:
DescriptorException

createClassDescriptor

public abstract ClassDescriptor createClassDescriptor(java.lang.String classtype,
                                                      AttributeDescriptor[] attributes,
                                                      LinkDescriptor[] links)
                                               throws DescriptorException
Creates an instance of ClassDescriptor. The classtype must be unique. An exception is thrown if a ClassDescriptor instance has already been created for an equal classtype. Use multiple links with care, because they produce much overhead.

The AttributeDescriptor[] must not contain a Descriptor for the persistence key Attribute, as this will be generated by the framework (of AttributeType.STRING with a default length).

Parameters:
classtype - unique type key
links - all links contained in this class
Returns:
instance of ClassDescriptor
Throws:
DescriptorException

getClassDescriptor

public abstract ClassDescriptor getClassDescriptor(java.lang.String classtype)
Returns a ClassDescriptor instance for a defined classtype, if it is registered.

Parameters:
classtype - unique type key
Returns:
The ClassDescriptor instance

containsClassDescriptor

public abstract boolean containsClassDescriptor(java.lang.String classtype)
Checks if a ClassDescriptor instance has already been created for a classtype

Parameters:
classtype - unique type key
Returns:
true if ClassDescriptor is registered


Copyright © 2005 SAP AG. All Rights Reserved.