001: /*
002: * Copyright (C) 2005 Rob Manning
003: * manningr@users.sourceforge.net
004: *
005: * This library is free software; you can redistribute it and/or
006: * modify it under the terms of the GNU Lesser General Public
007: * License as published by the Free Software Foundation; either
008: * version 2.1 of the License, or (at your option) any later version.
009: *
010: * This library is distributed in the hope that it will be useful,
011: * but WITHOUT ANY WARRANTY; without even the implied warranty of
012: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
013: * Lesser General Public License for more details.
014: *
015: * You should have received a copy of the GNU Lesser General Public
016: * License along with this library; if not, write to the Free Software
017: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
018: */
019: package net.sourceforge.squirrel_sql.fw.sql;
020:
021: import net.sourceforge.squirrel_sql.fw.sql.DatabaseObjectType;
022: import net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo;
023:
024: public class MockDatabaseObjectInfo implements IDatabaseObjectInfo {
025:
026: private String simpleName = null;
027:
028: private String schemaName = null;
029:
030: private String catalogName = null;
031:
032: public MockDatabaseObjectInfo(String aSimpleName,
033: String aSchemaName, String aCatalog) {
034: simpleName = aSimpleName;
035: schemaName = aSchemaName;
036: catalogName = aCatalog;
037: }
038:
039: /* (non-Javadoc)
040: * @see net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo#getCatalogName()
041: */
042: public String getCatalogName() {
043: return catalogName;
044: }
045:
046: public void setCatalogName(String aName) {
047: catalogName = aName;
048: }
049:
050: /* (non-Javadoc)
051: * @see net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo#getDatabaseObjectType()
052: */
053: public DatabaseObjectType getDatabaseObjectType() {
054: return DatabaseObjectType.TABLE;
055: }
056:
057: /* (non-Javadoc)
058: * @see net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo#getQualifiedName()
059: */
060: public String getQualifiedName() {
061: return simpleName;
062: }
063:
064: /* (non-Javadoc)
065: * @see net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo#getSchemaName()
066: */
067: public String getSchemaName() {
068: return schemaName;
069: }
070:
071: public void setSchemaName(String aName) {
072: schemaName = aName;
073: }
074:
075: /* (non-Javadoc)
076: * @see net.sourceforge.squirrel_sql.fw.sql.IDatabaseObjectInfo#getSimpleName()
077: */
078: public String getSimpleName() {
079: return simpleName;
080: }
081:
082: /* (non-Javadoc)
083: * @see java.lang.Comparable#compareTo(java.lang.Object)
084: */
085: public int compareTo(IDatabaseObjectInfo o) {
086: // TODO Auto-generated method stub
087: System.err
088: .println("MockDatabaseObjectInfo.compareTo: stub not yet implemented");
089: return 0;
090: }
091:
092: public String toString() {
093: StringBuffer result = new StringBuffer();
094: result.append("catalog=");
095: result.append(catalogName);
096: result.append(" schema=");
097: result.append(schemaName);
098: result.append(" simpleName=");
099: result.append(simpleName);
100: return result.toString();
101: }
102: }
|