changeset 341:acbc6ab3c0b5 no-hierarchy

~ remove the PartialFunction flavour for Database: it's only a set of relations\!
author Alexandre Bertails <bertails@gmail.com>
date Sun, 13 Feb 2011 01:06:00 -0500
parents fd36781876e2
children 05d5a585b109
files rdb/src/main/scala/RDB.scala
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/rdb/src/main/scala/RDB.scala	Sun Feb 13 00:55:48 2011 -0500
+++ b/rdb/src/main/scala/RDB.scala	Sun Feb 13 01:06:00 2011 -0500
@@ -6,9 +6,9 @@
 object RDB {
 
   /**
-   * a Database maps a relation name to the actual Relation
+   * a Database defines a set of relations
    */
-  case class Database(private val m:Map[RelName, Relation]) extends PartialFunction[RelName, Relation] {
+  case class Database(private val m:Map[RelName, Relation]) {
     // tricky and evil
     // when the Database is created, it can go through all the foreign key and set the database field
     // this way, a Target can know directly the Relation without using Database
@@ -20,8 +20,7 @@
     }
 
     def apply(rn:RelName) = m(rn)
-    def isDefinedAt(rn:RelName) = m isDefinedAt rn
-    /** returns all the relations */
+    /** returns all the relations in this database */
     def relations:Set[Relation] = m.values.toSet
     /** return all the relations with at least on Candidate Key */
     def indexables = m collect { case (rn, r) if r.isIndexable => r }
Set up and maintained by W3C Systems Team, please report bugs to sysreq@w3.org.

W3C would like to thank Microsoft who donated the server that allows us to run this service.