--- /dev/null
+/*\r
+\r
+ Derby - Class org.apache.derby.iapi.sql.dictionary.DependencyDescriptor\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.iapi.sql.dictionary;\r
+\r
+import org.apache.derby.catalog.DependableFinder;\r
+import org.apache.derby.catalog.UUID;\r
+import org.apache.derby.iapi.sql.depend.Dependent;\r
+import org.apache.derby.iapi.sql.depend.Provider;\r
+\r
+/**\r
+ * DependencyDescriptor represents a persistent dependency between\r
+ * SQL objects, such as a TRIGGER being dependent on a TABLE.\r
+ * \r
+ * A DependencyDescriptor is stored in SYSDEPENDS as four\r
+ * separate columms corresponding to the getters of this class. \r
+ * \r
+ * \r
+ */\r
+public class DependencyDescriptor extends TupleDescriptor \r
+ implements UniqueTupleDescriptor\r
+{\r
+ /** public interface for this class is:\r
+ <ol>\r
+ <li>public DependableFinder getDependentFinder();</li>\r
+ <li>public UUID getProviderID();</li>\r
+ <li>public DependableFinder getProviderFinder();</li>\r
+ </ol>\r
+ */\r
+\r
+ // implementation\r
+ private final UUID dependentID;\r
+ private final DependableFinder dependentBloodhound;\r
+ private final UUID providerID;\r
+ private final DependableFinder providerBloodhound;\r
+\r
+ /**\r
+ * Constructor for a DependencyDescriptor\r
+ *\r
+ * @param dependent The Dependent\r
+ * @param provider The Provider\r
+ */\r
+\r
+ public DependencyDescriptor(\r
+ Dependent dependent,\r
+ Provider provider\r
+ )\r
+ {\r
+ dependentID = dependent.getObjectID();\r
+ dependentBloodhound = dependent.getDependableFinder();\r
+ providerID = provider.getObjectID();\r
+ providerBloodhound = provider.getDependableFinder();\r
+ }\r
+\r
+ /**\r
+ * Constructor for a DependencyDescriptor\r
+ *\r
+ * @param dependentID The Dependent ID\r
+ * @param dependentBloodhound The bloodhound for finding the Dependent\r
+ * @param providerID The Provider ID\r
+ * @param providerBloodhound The bloodhound for finding the Provider\r
+ */\r
+\r
+ public DependencyDescriptor(\r
+ UUID dependentID, DependableFinder dependentBloodhound,\r
+ UUID providerID, DependableFinder providerBloodhound\r
+ )\r
+ {\r
+ this.dependentID = dependentID;\r
+ this.dependentBloodhound = dependentBloodhound;\r
+ this.providerID = providerID;\r
+ this.providerBloodhound = providerBloodhound;\r
+ }\r
+\r
+ // DependencyDescriptor interface\r
+\r
+ /**\r
+ * Get the dependent's ID for the dependency.\r
+ *\r
+ * @return The dependent's ID.\r
+ */\r
+ public UUID getUUID()\r
+ {\r
+ return dependentID;\r
+ }\r
+\r
+ /**\r
+ * Get the dependent's type for the dependency.\r
+ *\r
+ * @return The dependent's type.\r
+ */\r
+ public DependableFinder getDependentFinder()\r
+ {\r
+ return dependentBloodhound;\r
+ }\r
+\r
+ /**\r
+ * Get the provider's ID for the dependency.\r
+ *\r
+ * @return The provider's ID.\r
+ */\r
+ public UUID getProviderID()\r
+ {\r
+ return providerID;\r
+ }\r
+\r
+ /**\r
+ * Get the provider's type for the dependency.\r
+ *\r
+ * @return The provider's type.\r
+ */\r
+ public DependableFinder getProviderFinder()\r
+ {\r
+ return providerBloodhound;\r
+ }\r
+}\r