|
Oracle Fusion Middleware Java API Reference for Oracle TopLink 11g Release 1 (11.1.1) E28847-01 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
org.eclipse.persistence.platform.database.oracle.publisher.sqlrefl.Name
org.eclipse.persistence.platform.database.oracle.publisher.sqlrefl.SqlName
public class SqlName
A SqlName encapsulates the name of a database entity, that is, anything declared directly within a schema. A SqlName identifies the schema in which the entity is declared, and the name of the entity within the schema. Schema and entity names are converted to a canonical form so that they may be compared accurately. Quotes are stripped, and names that are not quoted are shifted to upper case. This class implements 'equals' and 'hash', so that SqlNames may be stored in Hashtables. This class is currently used only for type names. An attribute of a type is not considered to be a SqlName, because it is nested within the type, not directly within the schema. A SqlName instance can describe a PL/SQL type. Both the PL/SQL type name and the corresponding SQL name are captured in the SqlName instance. The two names are accessed via getTypeName(), and getTargetTypeName().
Field Summary | |
---|---|
(package private) static int |
m_case |
protected int |
m_column |
protected boolean |
m_contextFromIntype |
protected java.lang.String |
m_convertInto |
protected java.lang.String |
m_convertIntoQualified |
protected java.lang.String |
m_convertOutOf |
protected java.lang.String |
m_convertOutOfQualified |
(package private) static java.lang.String |
m_defaultSchema |
protected boolean |
m_fromDB |
protected java.lang.Boolean |
m_hasConversion |
protected boolean |
m_isReused |
protected boolean |
m_isRowType |
protected int |
m_line |
protected static int |
m_pl2SQLCounter |
protected boolean |
m_predefined |
protected boolean |
m_printAsIs |
protected boolean |
m_quoted |
private static int |
m_rowtypeDistinguisher |
protected java.lang.String |
m_sourceName The original database type for the type represented. - If (m_sourceName==m_name), this type does not need conversion and can be published into Java classes directly. - If (m_sourceName! |
protected static int |
m_sql2PLCounter |
(package private) static int |
m_targetLang |
private static java.lang.String |
PUBLIC |
static java.lang.String |
ROWTYPE |
static java.lang.String |
ROWTYPE_PL |
static java.lang.String |
ROWTYPE_SQL |
Fields inherited from class org.eclipse.persistence.platform.database.oracle.publisher.sqlrefl.Name |
---|
m_annotation, m_context, m_name, NO_CONTEXT |
Constructor Summary | |
---|---|
(package private) |
SqlName(java.lang.String plsql, java.lang.String sql) |
|
SqlName(java.lang.String schema, java.lang.String type, boolean fromDB, boolean printAsIs, boolean predefined, java.lang.String convertInto, java.lang.String convertOutOf, java.lang.String conversionTarget, SqlReflector reflector) |
protected |
SqlName(java.lang.String schema, java.lang.String type, boolean fromDB, int line, int col, boolean printAsIs, boolean predefined, java.lang.String convertInto, java.lang.String convertOutOf, java.lang.String conversionTarget, SqlReflector reflector) |
|
SqlName(java.lang.String schema, java.lang.String type, boolean fromDB, int line, int col, SqlReflector reflector) Initializes a SqlName with the schema and name of a declared entity. |
|
SqlName(java.lang.String schema, java.lang.String type, boolean fromDB, int line, int col, java.lang.String packageName, SqlType parentType, SqlReflector reflector) Create a SqlName instance for a PL/SQL type, which requires extra identifying information, such the names for the package and method that mentions this PL/SQL type. |
|
SqlName(java.lang.String schema, java.lang.String type, boolean fromDB, SqlReflector reflector) |
Method Summary | |
---|---|
static boolean |
containsLowerChar(java.lang.String s) |
static java.lang.String |
dbifyName(java.lang.String s, java.sql.Connection conn) |
static java.lang.String |
dbifyName(java.lang.String s, SqlReflector reflector) |
static java.lang.String |
determineSqlName(java.lang.String packageName, java.lang.String[] sourceName, TypeClass parentType, boolean[] isRowType, SqlReflector reflector) Determine the SQL type name for a PL/SQL type. |
boolean |
equals(java.lang.Object obj) Returns true if and only if two Names are equal. |
static int |
getCase() |
int |
getColumn() Returns the column number where the sqlname was found by the parser. |
java.lang.String |
getDeclClass() Returns the declaration class name of an SqlName. |
java.lang.String |
getDeclClass(java.lang.String currPackage) |
java.lang.String |
getDeclItf() Returns the declaration interface name of a SqlName. |
java.lang.String |
getDeclItf(java.lang.String currPackage) Returns the declaration interface name of a SqlName. |
java.lang.String |
getDeclItfPackage() Returns the Java declaration interface of an SqlName. |
java.lang.String |
getDeclPackage() Returns the declaration package name of an SqlName. |
boolean |
getFromDB() Returns the boolean whether SqlName is from the DB. |
java.lang.String |
getFullTargetTypeName(int schemaName) |
java.lang.String |
getFullTypeName(int schemaName) |
private java.lang.String |
getFullTypeName(java.lang.String typeName, int schemaName) |
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() |
LangName |
getLangName() Returns the LangName of this SqlName. |
int |
getLine() Returns the line number where the sqlname was found by the parser. |
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() |
java.lang.String |
getQuotedSimpleName() |
java.lang.String |
getSchemaName() Returns the schema name of the declared entity. |
static int |
getTargetLang() |
java.lang.String |
getTargetTypeName() Return the SQL type name. |
java.lang.String |
getTypeName() Returns the name of the original database type. |
java.lang.String |
getUseClass() |
java.lang.String |
getUseClass(boolean full) |
java.lang.String |
getUseClass(java.lang.String currPackage) Returns the use class name of a SqlName. |
java.lang.String |
getUseItf() Returns the use interface name of a SqlName. |
java.lang.String |
getUseItf(java.lang.String currPackage) Returns the use interface name of a SqlName. |
java.lang.String |
getUseItfPackage() Returns the Java use interface |
java.lang.String |
getUsePackage() Returns the Java use package name of an SqlName. |
boolean |
hasConversion() |
boolean |
hasDeclItf() |
int |
hashCode() Returns a hash code for the Name. |
boolean |
hasUseClass() return ture, if this type has user subclass |
boolean |
hasUseItf() If both decl interface and use interface are defined, we use the latter |
static void |
initStaticVariables() |
static java.lang.String |
interfaceIfPossible(SqlName sqlName, boolean itfIfPossible) |
static boolean |
isAlpha(char ch) |
boolean |
isPredefined() |
boolean |
isQuoted() Returns the boolean whether SqlName was quoted or not |
static boolean |
isQuoted(java.lang.String str) Returns the boolean whether SqlName was quoted or not |
boolean |
isReused() |
boolean |
isRowType() |
static boolean |
langIsC() |
static boolean |
langIsCpp() |
static boolean |
langIsOtt() |
private static java.lang.String |
massageSchema(java.lang.String schema, boolean fromDB, boolean predefined, SqlReflector reflector) |
static void |
setCase(int caseOption) Set the default style of case conversion used to generate the Java equivalent of an unknown SQL name. |
static void |
setDefaultSchema(java.lang.String defaultSchema) Initialize the SqlName class with the default schema name, used when a SqlName is created without an explciit schema name |
LangName |
setLangName(java.lang.String packageName, java.lang.String useName, java.lang.String useItf, java.lang.String generatedName, java.lang.String generatedItf, java.lang.String hfile, SqlType firstParent, java.lang.String cppfile, boolean userNameGiven) Sets the LangName associated with this SqlName. |
static void |
setTargetLang(int targetLang) |
static java.lang.String |
sqlIdToJavaId(java.lang.String s, boolean wordBoundary) |
static java.lang.String |
sqlIdToJavaId(java.lang.String s, boolean wordBoundary, boolean avoidJavaPrimitives) |
private java.lang.String |
stripPublic(java.lang.String name) |
java.lang.String |
toQuotedString(boolean omitSchemaName) Returns the name of the declared entity as a quoted string. |
java.lang.String |
toString() Returns the complete name of the declared entity. |
private java.lang.String |
toString(boolean omitSchemaName) |
Methods inherited from class org.eclipse.persistence.platform.database.oracle.publisher.sqlrefl.Name |
---|
getAnnotation, getContextName, getSimpleName, renameJavaMethodPrefix, setAnnotation |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ROWTYPE
public static final java.lang.String ROWTYPE_PL
public static final java.lang.String ROWTYPE_SQL
private static int m_rowtypeDistinguisher
private static final java.lang.String PUBLIC
static java.lang.String m_defaultSchema
static int m_case
static int m_targetLang
protected static int m_sql2PLCounter
protected static int m_pl2SQLCounter
protected boolean m_fromDB
protected boolean m_contextFromIntype
protected int m_line
protected int m_column
protected boolean m_quoted
protected boolean m_printAsIs
protected java.lang.String m_sourceName
protected boolean m_isRowType
protected boolean m_isReused
protected boolean m_predefined
protected java.lang.Boolean m_hasConversion
protected java.lang.String m_convertOutOf
protected java.lang.String m_convertInto
protected java.lang.String m_convertOutOfQualified
protected java.lang.String m_convertIntoQualified
Constructor Detail |
---|
public SqlName(java.lang.String schema, java.lang.String type, boolean fromDB, int line, int col, SqlReflector reflector)
schema
- the schema in which the entity is declaredtype
- the declared name of the entity in the schemapublic SqlName(java.lang.String schema, java.lang.String type, boolean fromDB, SqlReflector reflector)
SqlName(java.lang.String plsql, java.lang.String sql)
public SqlName(java.lang.String schema, java.lang.String type, boolean fromDB, boolean printAsIs, boolean predefined, java.lang.String convertInto, java.lang.String convertOutOf, java.lang.String conversionTarget, SqlReflector reflector)
protected SqlName(java.lang.String schema, java.lang.String type, boolean fromDB, int line, int col, boolean printAsIs, boolean predefined, java.lang.String convertInto, java.lang.String convertOutOf, java.lang.String conversionTarget, SqlReflector reflector)
public SqlName(java.lang.String schema, java.lang.String type, boolean fromDB, int line, int col, java.lang.String packageName, SqlType parentType, SqlReflector reflector)
schema
-type
-parentType
- The PL/SQL package type that references to the SqlType for which the SqlName is created forMethod Detail |
---|
public static java.lang.String interfaceIfPossible(SqlName sqlName, boolean itfIfPossible)
public static java.lang.String determineSqlName(java.lang.String packageName, java.lang.String[] sourceName, TypeClass parentType, boolean[] isRowType, SqlReflector reflector)
public static void initStaticVariables()
public java.lang.String getSchemaName()
public java.lang.String getTypeName()
public java.lang.String getTargetTypeName()
public java.lang.String getFullTargetTypeName(int schemaName)
public java.lang.String getUseClass(java.lang.String currPackage)
getUseClass
in class Name
currPackage
- the package from which the class is referencedpublic java.lang.String getUseClass()
getUseClass
in class Name
public java.lang.String getUseClass(boolean full)
getUseClass
in class Name
public java.lang.String getUsePackage()
getUsePackage
in class Name
public boolean hasUseClass()
hasUseClass
in class Name
public java.lang.String getUseItf()
getUseItf
in class Name
public java.lang.String getUseItf(java.lang.String currPackage)
public java.lang.String getUseItfPackage()
getUseItfPackage
in class Name
public boolean hasUseItf()
hasUseItf
in class Name
public boolean hasDeclItf()
hasDeclItf
in class Name
public boolean getFromDB()
public int getLine()
public int getColumn()
public boolean isQuoted()
public static boolean isQuoted(java.lang.String str)
public java.lang.String getDeclClass()
getDeclClass
in class Name
public java.lang.String getDeclPackage()
getDeclPackage
in class Name
public java.lang.String getDeclClass(java.lang.String currPackage)
public java.lang.String getDeclItf()
getDeclItf
in class Name
public java.lang.String getDeclItf(java.lang.String currPackage)
public java.lang.String getDeclItfPackage()
getDeclItfPackage
in class Name
public LangName getLangName()
public LangName setLangName(java.lang.String packageName, java.lang.String useName, java.lang.String useItf, java.lang.String generatedName, java.lang.String generatedItf, java.lang.String hfile, SqlType firstParent, java.lang.String cppfile, boolean userNameGiven)
public java.lang.String toString()
toString
in class Name
public java.lang.String toQuotedString(boolean omitSchemaName)
private java.lang.String toString(boolean omitSchemaName)
public java.lang.String getQuotedSimpleName()
public static void setDefaultSchema(java.lang.String defaultSchema)
public static void setCase(int caseOption)
public static int getCase()
public static void setTargetLang(int targetLang)
public static int getTargetLang()
public static boolean langIsOtt()
public static boolean langIsC()
public static boolean langIsCpp()
public static boolean containsLowerChar(java.lang.String s)
public static java.lang.String sqlIdToJavaId(java.lang.String s, boolean wordBoundary)
public static java.lang.String sqlIdToJavaId(java.lang.String s, boolean wordBoundary, boolean avoidJavaPrimitives)
public static boolean isAlpha(char ch)
private static java.lang.String massageSchema(java.lang.String schema, boolean fromDB, boolean predefined, SqlReflector reflector)
public boolean equals(java.lang.Object obj)
equals
in class Name
public int hashCode()
hashCode
in class Name
public boolean isRowType()
public boolean isPredefined()
public boolean hasConversion()
public java.lang.String getOutOfConversion()
Returns null if this is not a PL/SQL type or if it does not have user-defined conversions.
public java.lang.String getIntoConversion()
Returns null if this is not a PL/SQL type or if it does not have user-defined conversions.
public java.lang.String getOutOfConversionQualified()
public java.lang.String getIntoConversionQualified()
public java.lang.String getFullTypeName(int schemaName)
private java.lang.String getFullTypeName(java.lang.String typeName, int schemaName)
public boolean isReused()
public static java.lang.String dbifyName(java.lang.String s, SqlReflector reflector)
public static java.lang.String dbifyName(java.lang.String s, java.sql.Connection conn)
private java.lang.String stripPublic(java.lang.String name)
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |