--- /dev/null
+/*\r
+\r
+ Derby - Class org.apache.derby.catalog.types.SynonymAliasInfo\r
+\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to You under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.catalog.types;\r
+\r
+import org.apache.derby.iapi.services.io.Formatable;\r
+import org.apache.derby.iapi.services.io.StoredFormatIds;\r
+import org.apache.derby.catalog.AliasInfo;\r
+import java.io.IOException;\r
+import java.io.ObjectInput;\r
+import java.io.ObjectOutput;\r
+\r
+/**\r
+ * Describe an S (Synonym) alias.\r
+ *\r
+ * @see AliasInfo\r
+ */\r
+public class SynonymAliasInfo implements AliasInfo, Formatable\r
+{\r
+ private String schemaName = null;\r
+ private String tableName = null;\r
+\r
+ public SynonymAliasInfo() {\r
+ }\r
+\r
+ /**\r
+ Create a SynonymAliasInfo for synonym.\r
+ */\r
+ public SynonymAliasInfo(String schemaName, String tableName)\r
+ {\r
+ this.schemaName = schemaName;\r
+ this.tableName = tableName;\r
+ }\r
+\r
+ public String getSynonymTable() {\r
+ return tableName;\r
+ }\r
+\r
+ public String getSynonymSchema() {\r
+ return schemaName;\r
+ }\r
+\r
+ // Formatable methods\r
+\r
+ /**\r
+ * Read this object from a stream of stored objects.\r
+ *\r
+ * @param in read this.\r
+ *\r
+ * @exception IOException thrown on error\r
+ * @exception ClassNotFoundException thrown on error\r
+ */\r
+ public void readExternal( ObjectInput in )\r
+ throws IOException, ClassNotFoundException\r
+ {\r
+ schemaName = (String) in.readObject();\r
+ tableName = (String) in.readObject();\r
+ }\r
+\r
+ /**\r
+ * Write this object to a stream of stored objects.\r
+ *\r
+ * @param out write bytes here.\r
+ *\r
+ * @exception IOException thrown on error\r
+ */\r
+ public void writeExternal( ObjectOutput out )\r
+ throws IOException\r
+ {\r
+ out.writeObject(schemaName);\r
+ out.writeObject(tableName);\r
+ }\r
+ \r
+ /**\r
+ * Get the formatID which corresponds to this class.\r
+ *\r
+ * @return the formatID of this class\r
+ */\r
+ public int getTypeFormatId() { return StoredFormatIds.SYNONYM_INFO_V01_ID; }\r
+\r
+ public String toString() {\r
+ return "\"" + schemaName + "\".\"" + tableName + "\"";\r
+ }\r
+\r
+ public String getMethodName()\r
+ {\r
+ return null;\r
+ }\r
+}\r
+\r