/** * INTERNAL * return a boolean which determines where TopLink should include the TopLink-stored * Internal exception in it's stack trace. For JDK 1.4 VMs with exception chaining * the Internal exception can be redundant and confusing. * @return boolean */ public static boolean shouldPrintInternalException() { return getPlatform().shouldPrintInternalException(); } }
/** * Answer a Timestamp from a Calendar. */ public static java.sql.Timestamp timestampFromCalendar(Calendar calendar) { return timestampFromLong(JavaPlatform.getTimeInMillis(calendar)); }
/** * Return the qualified name of the field. */ public String getQualifiedName() { if (hasTableName()) { return getTable().getQualifiedName() + "." + getName(); } else { return getName(); } }
/** */ public boolean isNumericType(Object type) { return isIntegralType(type) || isFloatingPointType(type) || isBigIntegerType(type) || isBigDecimalType(type); }
/** Returns true if the specified type denotes an orable type */ public boolean isOrderableType(Object type) { return isNumericType(type) || isStringType(type) || isDateClass(type) || isEnumType(type); }
/** * INTERNAL: */ protected MetadataPrimaryKeyJoinColumn(String sourceTableName, String targetTableName, String defaultPKFieldName, String defaultFKFieldName) { m_pkField = new DatabaseField(); m_pkField.setName(defaultPKFieldName); m_pkField.setTableName(sourceTableName); m_fkField = new DatabaseField(); m_fkField.setName(defaultFKFieldName); m_fkField.setTableName(targetTableName); m_fkField.setColumnDefinition(DEFAULT_COLUMN_DEFINITION); }
/** * INTERNAL: * Conform an expression which uses the operator "like" for an in-memory query * @return int * int FALSE = 0 - if the expression does not conform * int TRUE = 1 - if the expression does conform * int UNDEFINED = 2 - if it cannot be determined if the expression conforms */ public static int conformLike(Object left, Object right) { return getPlatform().conformLike(left, right); }
/** * INTERNAL: * Get the milliseconds from a Calendar. * @param calendar the instance of calendar to get the millis from * @return long the number of millis */ public static long getTimeInMillis(java.util.Calendar calendar) { return getPlatform().getTimeInMillis(calendar); }
/** * INTERNAL: * Set the cause of an exception. This is useful for JDK 1.4 exception chaining * @param java.lang.Throwable the exception to set the cause for * @param java.lang.Throwable the cause of this exception */ public static void setExceptionCause(Throwable exception, Throwable cause) { getPlatform().setExceptionCause(exception, cause); }
/** * Build a valid instance of java.util.Calendar from the given source object. * @param sourceObject Valid instance of java.util.Date, String, java.sql.Timestamp, or Long */ protected Calendar convertObjectToCalendar(Object sourceObject) throws ConversionException { if (sourceObject instanceof Calendar) { return (Calendar)sourceObject; } else if (sourceObject instanceof java.util.Date) { // PERF: Avoid double conversion for date subclasses. return Helper.calendarFromUtilDate((java.util.Date)sourceObject); } return Helper.calendarFromUtilDate(convertObjectToUtilDate(sourceObject)); }
/** * INTERNAL: * Get the Map to store the query cache in */ public static java.util.Map getQueryCacheMap() { return getPlatform().getQueryCacheMap(); }
/** * INTERNAL: * Set the milliseconds for a Calendar. */ public static void setTimeInMillis(java.util.Calendar calendar, long millis) { getPlatform().setTimeInMillis(calendar, millis); }
/** * Set the table name for this field. */ public void setTableName(String tableName) { setTable(new DatabaseTable(tableName)); }
/** * <p>Deep clone a Serializable object using serialization. * @param the serializable object * @return the deep cloned object * @throws IOException, ClassNotFoundException */ public static Object clone(Serializable object) throws IOException, ClassNotFoundException { return deserialize(serialize(object)); }
/** * Answer a Date from a timestamp * * This implementation is based on the java.sql.Date class, not java.util.Date. * @param timestampObject - timestamp representation of date * @return - date representation of timestampObject */ public static java.sql.Date dateFromTimestamp(java.sql.Timestamp timestamp) { return sqlDateFromUtilDate(timestamp); }
/** * Returns the object class. If a class is primitive return its non primitive class */ public static Class getObjectClass(Class javaClass) { return ConversionManager.getObjectClass(javaClass); }
/** * Print the time part of the calendar. */ public static String printTime(Calendar calendar) { return printTime(calendar, true); }
public void setSize(int newSize) { modCount++; if (newSize > elementCount) { ensureCapacityHelper(newSize); } else { for (int i = newSize ; i < elementCount ; i++) { elementData[i] = null; } } elementCount = newSize; }
public DatabaseField(String fieldName, DatabaseTable databaseTable) { this.index = -1; this.sqlType = -1; this.name = fieldName; this.table = databaseTable; initDDLFields(); }