Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle TopLink
11g Release 1 (11.1.1)

E28847-01


org.eclipse.persistence.platform.database.oracle.publisher.sqlrefl
Class TypeClass

java.lang.Object
  extended by org.eclipse.persistence.platform.database.oracle.publisher.sqlrefl.TypeClass

Direct Known Subclasses:
JavaType, SqlType

public abstract class TypeClass
extends java.lang.Object

Instances of the class Type represent user-declared or predefined types in SQL or PL/SQL that may have fields and methods. Currently, subclasses of Type represent PL/SQL packages, the top-level PL/SQL scope, Oracle 8 user-defined types (objects, varrays and nested tables) and the primitive database types.

This class is analogous to java.lang.Class.


Field Summary
protected  java.lang.Object m_annotation
           
protected  java.lang.String m_hint
           
protected  boolean m_isPrimitive
           
protected  Name m_name
           
protected  java.util.List<java.lang.String> m_namedTranslations
           
protected  int m_typecode
           

 

Constructor Summary
protected TypeClass(Name name, int typecode, boolean isPrimitive)
           

 

Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Object getAnnotation()
          Returns the annotation associated with the Type.
 TypeClass getComponentType()
          If this Type has a component type, return the Type object that represents the component type; otherwise returns null.
 java.util.List<AttributeField> getDeclaredFields(boolean publishedOnly)
          Returns an array of Field objects reflecting all the fields declared by this Type object.
 java.util.List<ProcedureMethod> getDeclaredMethods()
          Returns an array of Method objects reflecting all the methods declared by this Type object.
 java.util.List<AttributeField> getFields(boolean publishedOnly)
          Returns an array of Field objects reflecting all the accessible fields of this Type object.
 java.lang.String getHint()
          Returns a hint associated with the Type.
 java.lang.String getIntoConversion()
          Returns the PL/SQL function to be used for converting a SQL type into this PL/SQL type, qualified with package name.
 java.lang.String getIntoConversionQualified()
          Returns the PL/SQL function to be used for converting a SQL type into this PL/SQL type, qualified with package name.
 int getJdbcTypecode()
          Return a JDBC typecode for this type.
 int getModifiers()
          Returns the modifiers for this type, encoded in an integer.
 java.lang.String getName()
          Returns the fully-qualified name of the type represented by this Type object, as a String.
 java.util.List<java.lang.String> getNamedTranslations()
           
 Name getNameObject()
           
 java.lang.String getOutOfConversion()
          Returns the PL/SQL function to be used for converting this PL/SQL into a SQL type.
 java.lang.String getOutOfConversionQualified()
          Returns the PL/SQL function to be used for converting this PL/SQL into a SQL type, qualified with package name.
 TypeClass getSupertype()
          Returns the Type representing the supertype of the entity represented by this Type.
 int getTypecode()
          Return the typecode for this type.
 boolean hasConversion()
          Reports whether this is a PL/SQL type which has user-defined conversion functions to a SQL type.
 int hashCode()
           
 boolean hasMethods()
           
 boolean isArray()
          Determines if this Type represents an array type.
 boolean isObject()
          Determines if this Type represents an object type.
 boolean isPackage()
          The remaining methods are not adapted from java.lang.Class
 boolean isPrimitive()
          Determines if this Type represents a primitive type.
 boolean isTable()
           
 void setAnnotation(java.lang.Object o)
          Sets the annotation associated with the Type.
 void setHint(java.lang.String s)
          Sets the hint associated with the Type.
 void setNamedTranslations(java.util.List<java.lang.String> v)
           
(package private)  void setNameObject(Name name)
           
 void setTypecode(int typecode)
          set the typecode for this type.
 java.lang.String toString()
          Converts the Type to a string, as it would appear in an error message.

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Field Detail

m_name

protected Name m_name

m_isPrimitive

protected boolean m_isPrimitive

m_typecode

protected int m_typecode

m_annotation

protected java.lang.Object m_annotation

m_hint

protected java.lang.String m_hint

m_namedTranslations

protected java.util.List<java.lang.String> m_namedTranslations

Constructor Detail

TypeClass

protected TypeClass(Name name,
                    int typecode,
                    boolean isPrimitive)

Method Detail

getComponentType

public TypeClass getComponentType()
                           throws java.sql.SQLException,
                                  PublisherException
If this Type has a component type, return the Type object that represents the component type; otherwise returns null.
Throws:
java.sql.SQLException
PublisherException

getDeclaredFields

public java.util.List<AttributeField> getDeclaredFields(boolean publishedOnly)
                                                 throws java.lang.SecurityException,
                                                        java.sql.SQLException,
                                                        PublisherException
Returns an array of Field objects reflecting all the fields declared by this Type object. Returns an array of length 0 if this Type object declares no fields.
Throws:
java.lang.SecurityException
java.sql.SQLException
PublisherException

getDeclaredMethods

public java.util.List<ProcedureMethod> getDeclaredMethods()
                                                   throws java.lang.SecurityException,
                                                          java.sql.SQLException,
                                                          PublisherException
Returns an array of Method objects reflecting all the methods declared by this Type object. Returns an array of length 0 if the Type declares no methods
Throws:
java.lang.SecurityException
java.sql.SQLException
PublisherException

getFields

public java.util.List<AttributeField> getFields(boolean publishedOnly)
                                         throws java.lang.SecurityException,
                                                java.sql.SQLException,
                                                PublisherException
Returns an array of Field objects reflecting all the accessible fields of this Type object. Returns an array of length 0 if this Type object has no accesible fields.
Throws:
java.lang.SecurityException
java.sql.SQLException
PublisherException

getModifiers

public int getModifiers()
                 throws java.sql.SQLException
Returns the modifiers for this type, encoded in an integer. The modifiers currently in use are: public (always set) final abstract The modifiers are decoded using the methods of java.lang.reflect.Modifier. If we ever need additional modifiers for C++, we can subclass Modifier.
Throws:
java.sql.SQLException

getName

public java.lang.String getName()
Returns the fully-qualified name of the type represented by this Type object, as a String.

getSupertype

public TypeClass getSupertype()
                       throws java.sql.SQLException,
                              PublisherException
Returns the Type representing the supertype of the entity represented by this Type. If no supertype, returns null
Throws:
java.sql.SQLException
PublisherException

isArray

public boolean isArray()
Determines if this Type represents an array type.

isObject

public boolean isObject()
Determines if this Type represents an object type.

isPrimitive

public boolean isPrimitive()
Determines if this Type represents a primitive type.

toString

public java.lang.String toString()
Converts the Type to a string, as it would appear in an error message.
Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

isPackage

public boolean isPackage()
The remaining methods are not adapted from java.lang.Class

isTable

public boolean isTable()

getAnnotation

public java.lang.Object getAnnotation()
Returns the annotation associated with the Type. The annotation was set by the client of the Type using setAnnotation().

setAnnotation

public void setAnnotation(java.lang.Object o)
Sets the annotation associated with the Type. The annotation is an arbitary object chosed by the client of the Type.

getHint

public java.lang.String getHint()
Returns a hint associated with the Type. Usually hints are used for index-by table types.

setHint

public void setHint(java.lang.String s)
Sets the hint associated with the Type. Usually hints are used for index-by table types.

getNamedTranslations

public java.util.List<java.lang.String> getNamedTranslations()

setNamedTranslations

public void setNamedTranslations(java.util.List<java.lang.String> v)

getTypecode

public int getTypecode()
Return the typecode for this type.

setTypecode

public void setTypecode(int typecode)
set the typecode for this type.

getJdbcTypecode

public int getJdbcTypecode()
Return a JDBC typecode for this type.

hasMethods

public boolean hasMethods()
                   throws java.sql.SQLException,
                          PublisherException
Throws:
java.sql.SQLException
PublisherException

getNameObject

public Name getNameObject()

setNameObject

void setNameObject(Name name)

hasConversion

public boolean hasConversion()
Reports whether this is a PL/SQL type which has user-defined conversion functions to a SQL type.

getOutOfConversion

public java.lang.String getOutOfConversion()
Returns the PL/SQL function to be used for converting this PL/SQL into a SQL type.

Returns null if this is not a PL/SQL type or if it does not have user-defined conversions.


getOutOfConversionQualified

public java.lang.String getOutOfConversionQualified()
Returns the PL/SQL function to be used for converting this PL/SQL into a SQL type, qualified with package name.

Returns null if this is not a PL/SQL type or if it does not have user-defined conversions.


getIntoConversion

public java.lang.String getIntoConversion()
Returns the PL/SQL function to be used for converting a SQL type into this PL/SQL type, qualified with package name.

Returns null if this is not a PL/SQL type or if it does not have user-defined conversions.


getIntoConversionQualified

public java.lang.String getIntoConversionQualified()
Returns the PL/SQL function to be used for converting a SQL type into this PL/SQL type, qualified with package name.

Returns null if this is not a PL/SQL type or if it does not have user-defined conversions.


Skip navigation links

Copyright © 1998, 2012, Oracle. All Rights Reserved.