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 SqlType

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

Direct Known Subclasses:
PlsqlIndexTableType, SerializableType, SqlCollectionType, SqlOpaqueType, SqlRefType, SqlSqljType, SqlStmtType, SqlTypeWithFields

public class SqlType
extends TypeClass

Field Summary
static int CODE_OPAQUE
           
static int CODE_SQLJTYPE
           
private  java.util.List<SqlType> m_dependTypes
           
protected  boolean m_isReused
           
protected  SqlType m_parentType
           
protected  SqlReflector m_reflector
           
protected  java.lang.String m_version
           
protected  ViewCache m_viewCache
           
static int ORACLE_TYPES_BOOLEAN
           
static int ORACLE_TYPES_NCHAR
           
static int ORACLE_TYPES_NCLOB
           
static int ORACLE_TYPES_TBD
           
static int SQLJTYPE_BOTH
           
static int SQLJTYPE_BOTH8I
           
static int SQLJTYPE_CUSTOMDATUM
           
static int SQLJTYPE_ORADATA
           
static int SQLJTYPE_SERIALIZABLE
           
static int SQLJTYPE_SQLDATA
           

 

Fields inherited from class org.eclipse.persistence.platform.database.oracle.publisher.sqlrefl.TypeClass
m_annotation, m_hint, m_isPrimitive, m_name, m_namedTranslations, m_typecode

 

Constructor Summary
(package private) SqlType(SqlName name, int typecode)
          This constructor is used for predefined PL/SQL to SQL type mapping.
(package private) SqlType(SqlName sqlName, int typecode, boolean generateMe, boolean isPrimitive, SqlType parentType, SqlReflector reflector)
           
protected SqlType(SqlName sqlName, int typecode, boolean generateMe, SqlType parentType, SqlReflector reflector)
          This constructor is used for user-defined and REF types.
  SqlType(java.lang.String name, int typecode)
          This constructor is used for predefined SQL types.

 

Method Summary
 void accept(PublisherVisitor v)
           
 void addAttribute(java.lang.String sqlField, java.lang.String javaField)
          Add an attribute to the collection of attributes of a SqlType.
(package private)  boolean dependsOn(SqlType t)
           
 java.util.Map<java.lang.String,java.lang.String> getAttributes()
          Get the attribute hashtable associated with a SqlType.
 java.lang.String getBothConversions()
           
 java.lang.String getConversionFunDecl()
           
 java.lang.String getConversionPL2SQLFunBody()
           
 java.lang.String getConversionSQL2PLFunBody()
           
 java.lang.String getIntoConversion()
          Returns the PL/SQL function to be used for converting a SQL type into this PL/SQL type.
 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.
 java.lang.String getIntoConvStmts(java.lang.String formatPrefix, java.lang.String maybeSql, java.lang.String maybePlsql)
           
 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.
 java.lang.String getOutOfConvStmts(java.lang.String formatPrefix, java.lang.String maybePlsql, java.lang.String maybeSql)
           
 int getSqljKind()
           
 SqlName getSqlName()
           
 java.lang.String getSqlTypeDecl()
           
 java.lang.String getSqlTypeDrop()
           
 java.lang.String getTargetTypeName()
          Reports the SQL type into which the PL/SQL can be converted.
 java.lang.String getTargetTypeName(int schemaNames)
           
 java.lang.String getTypeName()
           
 java.lang.String getVersion()
          Returns the version string of a SqlType
 boolean hasConversion()
          Reports whether this is a PL/SQL type which has user-defined conversion functions to a SQL type.
 boolean isCollection()
           
 boolean isJavaStruct()
           
 boolean isOpaque()
           
 boolean isPlsqlRecord()
           
 boolean isPlsqlTable()
           
 boolean isRef()
           
 boolean isSqlStatement()
           
 boolean isStruct()
           
 void setVersion(java.lang.String version)
          Set the version string of a declared type

 

Methods inherited from class org.eclipse.persistence.platform.database.oracle.publisher.sqlrefl.TypeClass
equals, getAnnotation, getComponentType, getDeclaredFields, getDeclaredMethods, getFields, getHint, getJdbcTypecode, getModifiers, getName, getNamedTranslations, getNameObject, getSupertype, getTypecode, hashCode, hasMethods, isArray, isObject, isPackage, isPrimitive, isTable, setAnnotation, setHint, setNamedTranslations, setNameObject, setTypecode, toString

 

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

 

Field Detail

CODE_OPAQUE

public static final int CODE_OPAQUE
See Also:
Constant Field Values

CODE_SQLJTYPE

public static final int CODE_SQLJTYPE
See Also:
Constant Field Values

SQLJTYPE_SQLDATA

public static final int SQLJTYPE_SQLDATA
See Also:
Constant Field Values

SQLJTYPE_CUSTOMDATUM

public static final int SQLJTYPE_CUSTOMDATUM
See Also:
Constant Field Values

SQLJTYPE_SERIALIZABLE

public static final int SQLJTYPE_SERIALIZABLE
See Also:
Constant Field Values

SQLJTYPE_ORADATA

public static final int SQLJTYPE_ORADATA
See Also:
Constant Field Values

SQLJTYPE_BOTH

public static final int SQLJTYPE_BOTH
See Also:
Constant Field Values

SQLJTYPE_BOTH8I

public static final int SQLJTYPE_BOTH8I
See Also:
Constant Field Values

ORACLE_TYPES_NCHAR

public static final int ORACLE_TYPES_NCHAR
See Also:
Constant Field Values

ORACLE_TYPES_NCLOB

public static final int ORACLE_TYPES_NCLOB
See Also:
Constant Field Values

ORACLE_TYPES_BOOLEAN

public static final int ORACLE_TYPES_BOOLEAN
See Also:
Constant Field Values

ORACLE_TYPES_TBD

public static final int ORACLE_TYPES_TBD
See Also:
Constant Field Values

m_version

protected java.lang.String m_version

m_reflector

protected SqlReflector m_reflector

m_viewCache

protected ViewCache m_viewCache

m_parentType

protected SqlType m_parentType

m_isReused

protected boolean m_isReused

m_dependTypes

private java.util.List<SqlType> m_dependTypes

Constructor Detail

SqlType

protected SqlType(SqlName sqlName,
                  int typecode,
                  boolean generateMe,
                  SqlType parentType,
                  SqlReflector reflector)
This constructor is used for user-defined and REF types. It may not be called more than once for the same non-null sqlName.

SqlType

SqlType(SqlName sqlName,
        int typecode,
        boolean generateMe,
        boolean isPrimitive,
        SqlType parentType,
        SqlReflector reflector)

SqlType

public SqlType(java.lang.String name,
               int typecode)
This constructor is used for predefined SQL types. It may not be called more than once for the same name.

SqlType

SqlType(SqlName name,
        int typecode)
This constructor is used for predefined PL/SQL to SQL type mapping.

Method Detail

getSqlName

public SqlName getSqlName()

isRef

public boolean isRef()

isCollection

public boolean isCollection()

isPlsqlTable

public boolean isPlsqlTable()

isPlsqlRecord

public boolean isPlsqlRecord()

isOpaque

public boolean isOpaque()

isJavaStruct

public boolean isJavaStruct()

isSqlStatement

public boolean isSqlStatement()

getSqljKind

public int getSqljKind()

isStruct

public boolean isStruct()

getVersion

public java.lang.String getVersion()
Returns the version string of a SqlType. * @return the version string of the type.

setVersion

public void setVersion(java.lang.String version)
Set the version string of a declared type. * @param version the version string of the type

getAttributes

public java.util.Map<java.lang.String,java.lang.String> getAttributes()
Get the attribute hashtable associated with a SqlType. The attributes in the hashtable were registered via addAttribute().

addAttribute

public void addAttribute(java.lang.String sqlField,
                         java.lang.String javaField)
Add an attribute to the collection of attributes of a SqlType. JPub only adds attributes mentioned in the input file.

dependsOn

boolean dependsOn(SqlType t)

hasConversion

public boolean hasConversion()
Description copied from class: TypeClass
Reports whether this is a PL/SQL type which has user-defined conversion functions to a SQL type.
Overrides:
hasConversion in class TypeClass

getTargetTypeName

public java.lang.String getTargetTypeName()
Reports the SQL type into which the PL/SQL can be converted. Returns null if not a PL/SQL type or if it doed not have a user-defined conversion.

getTargetTypeName

public java.lang.String getTargetTypeName(int schemaNames)

getTypeName

public java.lang.String getTypeName()

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.

Overrides:
getOutOfConversion in class TypeClass

getIntoConversion

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

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

Overrides:
getIntoConversion in class TypeClass

getOutOfConversionQualified

public java.lang.String getOutOfConversionQualified()
Description copied from class: TypeClass
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.

Overrides:
getOutOfConversionQualified in class TypeClass

getIntoConversionQualified

public java.lang.String getIntoConversionQualified()
Description copied from class: TypeClass
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.

Overrides:
getIntoConversionQualified in class TypeClass

getSqlTypeDecl

public java.lang.String getSqlTypeDecl()
                                throws java.sql.SQLException,
                                       PublisherException
Throws:
java.sql.SQLException
PublisherException

getSqlTypeDrop

public java.lang.String getSqlTypeDrop()
                                throws java.sql.SQLException,
                                       PublisherException
Throws:
java.sql.SQLException
PublisherException

getConversionFunDecl

public java.lang.String getConversionFunDecl()
                                      throws PublisherException,
                                             java.sql.SQLException
Throws:
PublisherException
java.sql.SQLException

getConversionPL2SQLFunBody

public java.lang.String getConversionPL2SQLFunBody()
                                            throws java.sql.SQLException,
                                                   PublisherException
Throws:
java.sql.SQLException
PublisherException

getConversionSQL2PLFunBody

public java.lang.String getConversionSQL2PLFunBody()
                                            throws java.sql.SQLException,
                                                   PublisherException
Throws:
java.sql.SQLException
PublisherException

getBothConversions

public java.lang.String getBothConversions()
                                    throws java.sql.SQLException,
                                           PublisherException
Throws:
java.sql.SQLException
PublisherException

getIntoConvStmts

public java.lang.String getIntoConvStmts(java.lang.String formatPrefix,
                                         java.lang.String maybeSql,
                                         java.lang.String maybePlsql)
                                  throws java.sql.SQLException,
                                         PublisherException
Throws:
java.sql.SQLException
PublisherException

getOutOfConvStmts

public java.lang.String getOutOfConvStmts(java.lang.String formatPrefix,
                                          java.lang.String maybePlsql,
                                          java.lang.String maybeSql)
                                   throws java.sql.SQLException,
                                          PublisherException
Throws:
java.sql.SQLException
PublisherException

accept

public void accept(PublisherVisitor v)

Skip navigation links

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