* @throws SQLException
*/
public ColumnInfo getColumnInfoForColumnName(Table table, Connection conn, DatastoreIdentifier column)
throws SQLException
{
ColumnInfo colInfo = null;
if (storeDataMgr.size() == 0)
{
// No SchemaData yet so go to the database directly to find any info for this table.
colInfo = RDBMSStoreHelper.getColumnInfoForColumnName(this, table, conn, column);
if (JPOXLogger.DATASTORE_SCHEMA.isDebugEnabled())
{
JPOXLogger.DATASTORE_SCHEMA.debug(LOCALISER_RDBMS.msg("050032", table, (colInfo != null ? "" + 1 : "" + 0)));
}
}
else
{
synchronized (this)
{
long now = System.currentTimeMillis();
// Get fully-qualified name for this table (regardless of whether it is specified by user)
DatastoreIdentifier tableId = ((AbstractTable)table).getDatastoreIdentifierFullyQualified();
List cols = null;
// Check if we already have valid info for this table in the cache
if (now >= columnInfoReadTimestamp &&
now < columnInfoReadTimestamp + COLUMN_INFO_EXPIRATION_MS)
{
cols = (List) columnInfoByColumnName.get(tableId.getIdentifier()+column.getIdentifier());
if (cols != null)
{
for(int i=0; i<cols.size(); i++)
{
String[] c = RDBMSStoreHelper.splitColumnIdentifierName(((RDBMSAdapter)this.getDatastoreAdapter()).getCatalogSeparator(), column.getIdentifier());
String columnName = column.getIdentifier();
if (c[RDBMSStoreHelper.TABLE_IDENTIFIER_COLUMN] != null)
{
columnName = c[RDBMSStoreHelper.TABLE_IDENTIFIER_COLUMN];
}
ColumnInfo ci = (ColumnInfo) cols.get(i);
if (ci.getColumnName().equals(columnName))
{
colInfo = ci;
}
}
}