Class Util
java.lang.Object
org.eclipse.persistence.tools.metadata.generation.Util
Utility class typically used when constructing JPA/JAXB metadata from a
list of meta-model database types.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final int
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static String
getAttributeTypeNameForFieldType
(FieldType fldType, DatabasePlatform dbPlatform) Return the attribute-type name for a given FieldType.static Class
<?> getClassFromJDBCTypeName
(String typeName, DatabasePlatform databasePlatform) Return the Class for a given type name using the provided DatabasePlatform.static String
getClassNameFromJDBCTypeName
(String typeName, DatabasePlatform databasePlatform) Return the Class name for a given type name using the provided DatabasePlatform.static String
getEntityName
(String tableName, String packageName) Returns a entity class name based on a given table or type name.static String
Returns a Java class name based on a given qualified name.static String
getGeneratedJavaClassName
(String name, String packageName) Returns a Java class name based on a given name and package.static int
getJDBCTypeFromTypeName
(String typeName) Return the JDBC type (as int) for a given type name.static String
getJDBCTypeName
(String typeName) Return the JDBC type name for a given type String.static String
getJDBCTypeNameFromType
(int jdbcType) Return the JDBC type name for a given JDBC type code.static String
getOraclePLSQLTypeForName
(String typeName) Return the Oracle PL/SQL name for a given PL/SQL scalar type.static String
Return a qualified compatible type name for the given DatabaseType.static String
getQualifiedTypeName
(DatabaseType dbType) Return a qualified type name for the given DatabaseType.protected static String
getTypeNameForDatabaseType
(DatabaseType dataType) Return the type name to be used for a given database type.static String
getUnqualifiedEntityName
(String tableName) Returns a unqualified entity class name based on a given table or type name.protected static void
handleOverloading
(List<ProcedureType> procedures) Convenience method that detects multiple procedures with the same procedure name, and updates the overload value on the relevant ProcedureTypes accordingly.static boolean
isArgPLSQLScalar
(String argTypeName) Indicates if a given argument type name is considered a PL/SQL scalar argument, i.e.protected static String
processTypeName
(String typeName) Alter the given type name if required.
-
Field Details
-
ARRAY_STR
- See Also:
-
BIGINT_STR
- See Also:
-
BINARY_STR
- See Also:
-
BLOB_STR
- See Also:
-
BOOLEAN_STR
- See Also:
-
CHAR_STR
- See Also:
-
CLOB_STR
- See Also:
-
DATE_STR
- See Also:
-
DECIMAL_STR
- See Also:
-
DOUBLE_STR
- See Also:
-
FLOAT_STR
- See Also:
-
INTEGER_STR
- See Also:
-
LONG_STR
- See Also:
-
LONGRAW_STR
- See Also:
-
LONGVARBINARY_STR
- See Also:
-
NCHAR_STR
- See Also:
-
NCLOB_STR
- See Also:
-
NUMBER_STR
- See Also:
-
NUMERIC_STR
- See Also:
-
NVARCHAR_STR
- See Also:
-
NVARCHAR2_STR
- See Also:
-
OTHER_STR
- See Also:
-
RAW_STR
- See Also:
-
REAL_STR
- See Also:
-
ROWID_STR
- See Also:
-
ROWTYPE_STR
- See Also:
-
SMALLINT_STR
- See Also:
-
STRUCT_STR
- See Also:
-
TIME_STR
- See Also:
-
TIMESTAMP_STR
- See Also:
-
TINYINT_STR
- See Also:
-
UROWID_STR
- See Also:
-
VARBINARY_STR
- See Also:
-
VARCHAR_STR
- See Also:
-
VARCHAR2_STR
- See Also:
-
BINARY_INTEGER_STR
- See Also:
-
PLS_INTEGER_STR
- See Also:
-
NATURAL_STR
- See Also:
-
POSITIVE_STR
- See Also:
-
SIGNTYPE_STR
- See Also:
-
BINARY_INTEGER_TYPE_STR
- See Also:
-
PLS_BOOLEAN_TYPE_STR
- See Also:
-
PLS_INTEGER_TYPE_STR
- See Also:
-
NATURAL_TYPE_STR
- See Also:
-
POSITIVE_TYPE_STR
- See Also:
-
SIGNTYPE_TYPE_STR
- See Also:
-
SYS_XMLTYPE_STR
- See Also:
-
XMLTYPE_STR
- See Also:
-
_TYPE_STR
- See Also:
-
COMMA
- See Also:
-
SINGLE_SPACE
- See Also:
-
COMMA_SPACE_STR
- See Also:
-
ALL_QUERYNAME
- See Also:
-
PK_QUERYNAME
- See Also:
-
CREATE_OPERATION_NAME
- See Also:
-
UPDATE_OPERATION_NAME
- See Also:
-
REMOVE_OPERATION_NAME
- See Also:
-
OPEN_BRACKET
- See Also:
-
CLOSE_BRACKET
- See Also:
-
TYPE_STR
- See Also:
-
SELECT_FROM_STR
- See Also:
-
WHERE_STR
- See Also:
-
AND_STR
- See Also:
-
SET_STR
- See Also:
-
VALUES_STR
- See Also:
-
UPDATE_STR
- See Also:
-
INSERT_STR
- See Also:
-
DELETE_STR
- See Also:
-
EQUALS_BINDING1_STR
- See Also:
-
EQUALS_BINDING_STR
- See Also:
-
QUESTION_STR
- See Also:
-
ARRAY_CLS_STR
- See Also:
-
NCLOB_CLS_STR
- See Also:
-
OPAQUE_CLS_STR
- See Also:
-
ROWID_CLS_STR
- See Also:
-
STRUCT_CLS_STR
- See Also:
-
ORACLE_TIMESTAMP_CLS_STR
- See Also:
-
DOT
- See Also:
-
PERCENT
- See Also:
-
UNDERSCORE
- See Also:
-
ITEMS_FLD_STR
- See Also:
-
ITEMS_COL_STR
- See Also:
-
OPAQUE
public static final int OPAQUE- See Also:
-
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
getUnqualifiedEntityName
Returns a unqualified entity class name based on a given table or type name. The returned string will contain an upper case first char, with the remaining chars in lower case format. -
getEntityName
Returns a entity class name based on a given table or type name. The returned string will contain an upper case first char, with the remaining chars in lower case format. The packageName will be prepended to the Entity name if non-null. -
getJDBCTypeName
Return the JDBC type name for a given type String. -
getJDBCTypeFromTypeName
Return the JDBC type (as int) for a given type name. -
getJDBCTypeNameFromType
Return the JDBC type name for a given JDBC type code. -
getClassNameFromJDBCTypeName
public static String getClassNameFromJDBCTypeName(String typeName, DatabasePlatform databasePlatform) Return the Class name for a given type name using the provided DatabasePlatform. Object.class.getName() will be returned if the DatabasePlatform returns null. -
getClassFromJDBCTypeName
Return the Class for a given type name using the provided DatabasePlatform. Object.class will be returned if the DatabasePlatform returns null. -
processTypeName
Alter the given type name if required. -
getGeneratedJavaClassName
Returns a Java class name based on a given qualified name. If the name has a package prepended to it, the the returned string will be in the format 'packagename.Name', otherwise the format will be 'Name'. For example, given the name 'test.EMPLOYEE', the method would return the string 'test.Employee'. -
getGeneratedJavaClassName
Returns a Java class name based on a given name and package. The returned string will be in the format 'packagename.Name'. For example, given the name 'EMPLOYEE' and packageName 'TEST', the method would return the string 'test.Employee'. -
getQualifiedTypeName
Return a qualified type name for the given DatabaseType. If the type is a PLSQLType or a PLSQLCursor, and there is a package name available on the type's parent, a string will be returned in the format 'package.typename'. Otherwise the type name will be returned. -
getQualifiedCompatibleTypeName
Return a qualified compatible type name for the given DatabaseType. If the type is a PLSQLType, and there is a package name available on the type's parent, a string will be returned in the format 'package_typename'. Otherwise the type name will be returned. A compatible type is the JDBC type equivalent of a PL/SQL type. -
isArgPLSQLScalar
Indicates if a given argument type name is considered a PL/SQL scalar argument, i.e. is one of BOOLEAN, BINARY_INTEGER, PLS_INTEGER, etc. -
getOraclePLSQLTypeForName
Return the Oracle PL/SQL name for a given PL/SQL scalar type. -
getAttributeTypeNameForFieldType
protected static String getAttributeTypeNameForFieldType(FieldType fldType, DatabasePlatform dbPlatform) Return the attribute-type name for a given FieldType. For CHAR sized type, java.lang.Character will be returned. For CHAR non-sized type, java.lang.String will be returned. For non-CHAR type, the database platform will be used to get the type name. If the type to be returned is oracle.sql.Timestamp, java.sql.Timestamp will be returned instead (to handle conversion issue with Oracle11Platform) -
getTypeNameForDatabaseType
Return the type name to be used for a given database type. The given DatabaseType's typeName attribute is typically returned, however, in some cases special handling may be required. For example, in the case of a NumericType instance, "DECIMAL" should be used for the type name. -
handleOverloading
Convenience method that detects multiple procedures with the same procedure name, and updates the overload value on the relevant ProcedureTypes accordingly. The first ProcedureType will have an overload value of 0, the second 1, and so on.
-