From 10aa20170079d81f3e80d1cf5d0fc821336ae2d9 Mon Sep 17 00:00:00 2001 From: michelou Date: Mon, 30 Apr 2007 17:47:18 +0000 Subject: re-added links to Scala sources --- src/dbc/scala/dbc/statement/AccessMode.scala | 10 +++---- src/dbc/scala/dbc/statement/DerivedColumn.scala | 24 ++++++++------- src/dbc/scala/dbc/statement/Expression.scala | 17 +++++------ src/dbc/scala/dbc/statement/Insert.scala | 25 +++++++--------- src/dbc/scala/dbc/statement/InsertionData.scala | 25 ++++++++-------- src/dbc/scala/dbc/statement/IsolationLevel.scala | 8 ++--- src/dbc/scala/dbc/statement/JoinType.scala | 29 +++++++++++------- src/dbc/scala/dbc/statement/Jointure.scala | 24 +++++++-------- src/dbc/scala/dbc/statement/Select.scala | 38 +++++++++++++----------- src/dbc/scala/dbc/statement/SetClause.scala | 15 +++++----- src/dbc/scala/dbc/statement/SetQuantifier.scala | 20 ++++++++----- src/dbc/scala/dbc/statement/Statement.scala | 10 +++---- src/dbc/scala/dbc/statement/Status.scala | 18 ++++++----- src/dbc/scala/dbc/statement/Table.scala | 18 +++++------ 14 files changed, 143 insertions(+), 138 deletions(-) (limited to 'src/dbc') diff --git a/src/dbc/scala/dbc/statement/AccessMode.scala b/src/dbc/scala/dbc/statement/AccessMode.scala index d6b45ea9bc..19809a6735 100644 --- a/src/dbc/scala/dbc/statement/AccessMode.scala +++ b/src/dbc/scala/dbc/statement/AccessMode.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -9,16 +9,16 @@ // $Id:AccessMode.scala 6853 2006-03-20 16:58:47 +0100 (Mon, 20 Mar 2006) dubochet $ -package scala.dbc.statement; +package scala.dbc.statement abstract class AccessMode { - def sqlString: String; + def sqlString: String } object AccessMode { case object ReadOnly extends AccessMode { - def sqlString = "READ ONLY"; + def sqlString = "READ ONLY" } case object ReadWrite extends AccessMode { def sqlString = "READ WRITE" diff --git a/src/dbc/scala/dbc/statement/DerivedColumn.scala b/src/dbc/scala/dbc/statement/DerivedColumn.scala index 653ce75698..2e4dc4f6cd 100644 --- a/src/dbc/scala/dbc/statement/DerivedColumn.scala +++ b/src/dbc/scala/dbc/statement/DerivedColumn.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -9,28 +9,30 @@ // $Id$ -package scala.dbc.statement; +package scala.dbc.statement abstract class DerivedColumn { /** The value for the column. This value can be of any type but must be - * calculated from fields that appear in a relation that takes part - * in the query. */ - def valueExpression: Expression; + * calculated from fields that appear in a relation that takes part + * in the query. + */ + def valueExpression: Expression /** A new name for this field. This name must be unique for the query in - * which the column takes part. */ - def asClause: Option[String]; + * which the column takes part. + */ + def asClause: Option[String] /** A SQL-99 compliant string representation of the derived column - * sub-statement. This only has a meaning inside a select statement. */ - def sqlString: String = ( + * sub-statement. This only has a meaning inside a select statement. + */ + def sqlString: String = valueExpression.sqlInnerString + (asClause match { case None => "" case Some(ac) => " AS " + ac }) - ); } diff --git a/src/dbc/scala/dbc/statement/Expression.scala b/src/dbc/scala/dbc/statement/Expression.scala index 6243564311..531288ec47 100644 --- a/src/dbc/scala/dbc/statement/Expression.scala +++ b/src/dbc/scala/dbc/statement/Expression.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -9,21 +9,20 @@ // $Id$ -package scala.dbc.statement; +package scala.dbc.statement /** An expression that calculates some value from fields. */ abstract class Expression extends Relation { - def fieldTypes: List[DataType] = Nil; + def fieldTypes: List[DataType] = Nil /** A SQL-99 compliant string representation of the expression. */ - def sqlString: String = { - "SELECT " + sqlInnerString - } + def sqlString: String = "SELECT " + sqlInnerString /** A SQL-99 compliant string representation of the relation sub- - * statement. This only has a meaning inside another statement. */ - def sqlInnerString: String; + * statement. This only has a meaning inside another statement. + */ + def sqlInnerString: String } diff --git a/src/dbc/scala/dbc/statement/Insert.scala b/src/dbc/scala/dbc/statement/Insert.scala index 7e5ce777d8..a565c93585 100644 --- a/src/dbc/scala/dbc/statement/Insert.scala +++ b/src/dbc/scala/dbc/statement/Insert.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -9,28 +9,23 @@ // $Id:Insert.scala 6853 2006-03-20 16:58:47 +0100 (Mon, 20 Mar 2006) dubochet $ -package scala.dbc.statement; +package scala.dbc.statement -import scala.dbc.statement.expression._; +import scala.dbc.statement.expression._ /** An insertion of values into a table. */ -case class Insert ( - insertionTarget: String, - insertionData: InsertionData -) extends Status { +case class Insert(insertionTarget: String, insertionData: InsertionData) + extends Status { /** A SQL-99 compliant string representation of the select statement. */ - def sqlString: String = ( - "INSERT INTO " + - insertionTarget + - " " + insertionData.sqlString - ); + def sqlString: String = + "INSERT INTO " + insertionTarget + " " + insertionData.sqlString /** The name of the table where the data should be added. */ - //def insertionTarget: String; + //def insertionTarget: String /** The data that will be added tot he table. */ - //def insertionData: InsertionData; + //def insertionData: InsertionData } diff --git a/src/dbc/scala/dbc/statement/InsertionData.scala b/src/dbc/scala/dbc/statement/InsertionData.scala index cc9a225ad2..5aa8a7d368 100644 --- a/src/dbc/scala/dbc/statement/InsertionData.scala +++ b/src/dbc/scala/dbc/statement/InsertionData.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -9,33 +9,32 @@ // $Id:InsertionData.scala 6853 2006-03-20 16:58:47 +0100 (Mon, 20 Mar 2006) dubochet $ -package scala.dbc.statement; +package scala.dbc.statement -import scala.dbc.statement.expression._; +import scala.dbc.statement.expression._ /** Data to be inserted into a table in an Insert. */ abstract class InsertionData { - def sqlString: String; + def sqlString: String } object InsertionData { /** Insertion of data resulting from a query on the database. */ - case class Subquery (query:Relation) extends InsertionData { - def sqlString = query.sqlString; + case class Subquery(query: Relation) extends InsertionData { + def sqlString = query.sqlString } /** Insertion of data as explicitly defined values. */ - case class Constructor ( - columnNames:Option[List[String]], - columnValues:List[Expression] + case class Constructor( + columnNames: Option[List[String]], + columnValues: List[Expression] ) extends InsertionData { - def sqlString = ( + def sqlString = (columnNames match { case None => "" case Some(cn) => cn.mkString(" (",", ",")") }) + " VALUES" + - columnValues.map(e=>e.sqlInnerString).mkString(" (",", ",")") - ) + columnValues.map(e => e.sqlInnerString).mkString(" (",", ",")") } } diff --git a/src/dbc/scala/dbc/statement/IsolationLevel.scala b/src/dbc/scala/dbc/statement/IsolationLevel.scala index 92cead7c51..3b1619c72d 100644 --- a/src/dbc/scala/dbc/statement/IsolationLevel.scala +++ b/src/dbc/scala/dbc/statement/IsolationLevel.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -9,11 +9,11 @@ // $Id:IsolationLevel.scala 6853 2006-03-20 16:58:47 +0100 (Mon, 20 Mar 2006) dubochet $ -package scala.dbc.statement; +package scala.dbc.statement abstract class IsolationLevel { - def sqlString: String; + def sqlString: String } object IsolationLevel { diff --git a/src/dbc/scala/dbc/statement/JoinType.scala b/src/dbc/scala/dbc/statement/JoinType.scala index 77befa5607..e60fc5a979 100644 --- a/src/dbc/scala/dbc/statement/JoinType.scala +++ b/src/dbc/scala/dbc/statement/JoinType.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -9,39 +9,46 @@ // $Id$ -package scala.dbc.statement; +package scala.dbc.statement /** A join behaviour in a Jointure. */ abstract class JoinType { /** A SQL-99 string representation of the join behaviour. */ - def sqlString: String; + def sqlString: String } object JoinType { + /** A join behaviour where a joined tuple is created only when a - * corresponding tuple exists in both original relations. */ + * corresponding tuple exists in both original relations. + */ case object Inner extends JoinType { val sqlString = "INNER JOIN" } + /** A join behaviour family where a joined tuple is created even when a - * tuple has no corresponding tuple in the other relation. The fields - * populated by values of the other tuple will receive the NULL value. + * tuple has no corresponding tuple in the other relation. The fields + * populated by values of the other tuple will receive the NULL value. */ - abstract class Outer extends JoinType; + abstract class Outer extends JoinType + object Outer { /** An outer join behaviour where there will be at least on tuple for - * every tuple in the left relation. */ + * every tuple in the left relation. + */ case object Left extends Outer { val sqlString = "LEFT OUTER JOIN" } /** An outer join behaviour where there will be at least on tuple for - * every tuple in the right relation. */ + * every tuple in the right relation. + */ case object Right extends Outer { val sqlString = "RIGHT OUTER JOIN" } /** An outer join behaviour where there will be at least on tuple for - * every tuple in both right and left relations. */ + * every tuple in both right and left relations. + */ case object Full extends Outer { val sqlString = "FULL OUTER JOIN" } diff --git a/src/dbc/scala/dbc/statement/Jointure.scala b/src/dbc/scala/dbc/statement/Jointure.scala index 71fc610dcb..06d751a318 100644 --- a/src/dbc/scala/dbc/statement/Jointure.scala +++ b/src/dbc/scala/dbc/statement/Jointure.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -9,32 +9,31 @@ // $Id:Jointure.scala 6853 2006-03-20 16:58:47 +0100 (Mon, 20 Mar 2006) dubochet $ -package scala.dbc.statement; +package scala.dbc.statement /** A jointure between two relations. */ abstract class Jointure extends Relation { /** The relation on the left part of the join. */ - def leftRelation: Relation; + def leftRelation: Relation /** The relation on the right part of the join. */ - def rightRelation: Relation; + def rightRelation: Relation /** The type of the jointure. */ - def joinType: JoinType; + def joinType: JoinType /** The condition on which the jointure needs be done. */ - def joinCondition: Option[Expression]; + def joinCondition: Option[Expression] /** A SQL-99 compliant string representation of the relation statement. */ - def sqlString: String = { - "SELECT * FROM " + sqlInnerString - } + def sqlString: String = "SELECT * FROM " + sqlInnerString /** A SQL-99 compliant string representation of the relation sub- - * statement. This only has a meaning inside a query. */ - def sqlInnerString: String = ( + * statement. This only has a meaning inside a query. + */ + def sqlInnerString: String = leftRelation.sqlInnerString + " " + joinType.sqlString + " " + rightRelation.sqlInnerString + @@ -42,6 +41,5 @@ abstract class Jointure extends Relation { case Some(jc) => jc.sqlString case None => "" }) - ) } diff --git a/src/dbc/scala/dbc/statement/Select.scala b/src/dbc/scala/dbc/statement/Select.scala index 1d1fa64233..11bf98f322 100644 --- a/src/dbc/scala/dbc/statement/Select.scala +++ b/src/dbc/scala/dbc/statement/Select.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -9,7 +9,7 @@ // $Id:Select.scala 6853 2006-03-20 16:58:47 +0100 (Mon, 20 Mar 2006) dubochet $ -package scala.dbc.statement; +package scala.dbc.statement /** A statement that when executed on a database will return a relation. @@ -21,7 +21,7 @@ abstract class Select extends Relation { * relation.

Compatibility notice

Some DBMS (PostgreSQL) allow * uniqueness constrains on an arbitrary field instead of the entire * tuple. */ - def setQuantifier: Option[SetQuantifier]; + def setQuantifier: Option[SetQuantifier] /** Defines the output fields that a tuple in the returned relation will * contain, and their content with respect to the tables in the @@ -29,25 +29,28 @@ abstract class Select extends Relation { * empty), all possible input fields will be returned.

Compatibility * notice

SQL's qualified asterisk select sublist is not * available. */ - def selectList: List[DerivedColumn]; + def selectList: List[DerivedColumn] /** Defines the relations from which the query will obtain its data.*/ - def fromClause: List[Relation]; + def fromClause: List[Relation] /** Defines condition that must be true in the returned relation's tuples. - * This value expression must return a boolean or boolean-compatible - * value. This condition is applied before any GROUP BY clause. */ - def whereClause: Option[Expression]; + * This value expression must return a boolean or boolean-compatible + * value. This condition is applied before any GROUP BY clause. + */ + def whereClause: Option[Expression] /** Defines the grouping of the returned relation's tuples. One tuple is - * returned for every group. The value of selectList must - * use aggregate functions for calculation. */ - def groupByClause: Option[List[Expression]]; + * returned for every group. The value of selectList must + * use aggregate functions for calculation. + */ + def groupByClause: Option[List[Expression]] /** Defines conditions that must be true in the returned relation's tuples. - * The value expression must return a boolean can only refer to fields - * that are grouped or to any field from inside an aggregate function. */ - def havingClause: Option[Expression]; + * The value expression must return a boolean can only refer to fields + * that are grouped or to any field from inside an aggregate function. + */ + def havingClause: Option[Expression] /* def windowClause: Option[_]; */ @@ -89,7 +92,8 @@ abstract class Select extends Relation { ); /** A SQL-99 compliant string representation of the relation sub- - * statement. This only has a meaning inside a query. */ - def sqlInnerString: String = "("+sqlString+")"; + * statement. This only has a meaning inside a query. + */ + def sqlInnerString: String = "("+sqlString+")" } diff --git a/src/dbc/scala/dbc/statement/SetClause.scala b/src/dbc/scala/dbc/statement/SetClause.scala index dd25d2fef9..84633624bb 100644 --- a/src/dbc/scala/dbc/statement/SetClause.scala +++ b/src/dbc/scala/dbc/statement/SetClause.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -9,14 +9,13 @@ // $Id:SetClause.scala 6853 2006-03-20 16:58:47 +0100 (Mon, 20 Mar 2006) dubochet $ -package scala.dbc.statement; +package scala.dbc.statement -import scala.dbc.statement.expression._; +import scala.dbc.statement.expression._ /** Data to be inserted into a table in an Insert. */ -case class SetClause (name:String, expr:Expression) { - val value: Pair[String,Expression] = Pair(name,expr); - def sqlString: String = - value._1 + " = " + value._2.sqlInnerString; +case class SetClause(name: String, expr: Expression) { + val value: Pair[String,Expression] = (name, expr) + def sqlString: String = value._1 + " = " + value._2.sqlInnerString } diff --git a/src/dbc/scala/dbc/statement/SetQuantifier.scala b/src/dbc/scala/dbc/statement/SetQuantifier.scala index d1a9cfb7a2..7d735d1240 100644 --- a/src/dbc/scala/dbc/statement/SetQuantifier.scala +++ b/src/dbc/scala/dbc/statement/SetQuantifier.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -9,26 +9,30 @@ // $Id:SetQuantifier.scala 6853 2006-03-20 16:58:47 +0100 (Mon, 20 Mar 2006) dubochet $ -package scala.dbc.statement; +package scala.dbc.statement /** A set quantifier that defines the collection type of a relation. */ abstract class SetQuantifier { /** A SQL-99 compliant string representation of the set quantifier. */ - def sqlString: String; + def sqlString: String } object SetQuantifier { + /** A set quantifier that defines a relation as being a bag. That means - * that duplicates are allowed. */ + * that duplicates are allowed. + */ case object AllTuples extends SetQuantifier { /** A SQL-99 compliant string representation of the set quantifier. */ - def sqlString: String = "ALL"; + def sqlString: String = "ALL" } + /** A set quantifier that defines a relation as being a set. That means - * that duplicates are not allowed and will be pruned. */ + * that duplicates are not allowed and will be pruned. + */ case object DistinctTuples extends SetQuantifier { /** A SQL-99 compliant string representation of the set quantifier. */ - def sqlString: String = "DISTINCT"; + def sqlString: String = "DISTINCT" } } diff --git a/src/dbc/scala/dbc/statement/Statement.scala b/src/dbc/scala/dbc/statement/Statement.scala index f26e9b8654..b1580c8121 100644 --- a/src/dbc/scala/dbc/statement/Statement.scala +++ b/src/dbc/scala/dbc/statement/Statement.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -9,10 +9,8 @@ // $Id:Statement.scala 6853 2006-03-20 16:58:47 +0100 (Mon, 20 Mar 2006) dubochet $ -package scala.dbc.statement; +package scala.dbc.statement /** An ISO-9075:2003 (SQL) statement. */ -abstract class Statement { - -} +abstract class Statement diff --git a/src/dbc/scala/dbc/statement/Status.scala b/src/dbc/scala/dbc/statement/Status.scala index 9835b29e7f..521e546474 100644 --- a/src/dbc/scala/dbc/statement/Status.scala +++ b/src/dbc/scala/dbc/statement/Status.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -9,22 +9,24 @@ // $Id:Status.scala 6853 2006-03-20 16:58:47 +0100 (Mon, 20 Mar 2006) dubochet $ -package scala.dbc.statement; +package scala.dbc.statement +import scala.dbc.Database +import scala.dbc.result /** A statement that changes the status of the database. */ abstract class Status extends Statement { /** A SQL-99 compliant string representation of the statement. */ - def sqlString: String; + def sqlString: String /** Executes the statement on the given database. */ - def execute (database: scala.dbc.Database): scala.dbc.result.Status[Unit] = { - database.executeStatement(this); + def execute(database: Database): result.Status[Unit] = { + database.executeStatement(this) } - def execute (database: scala.dbc.Database, debug: Boolean): scala.dbc.result.Status[Unit] = { - database.executeStatement(this,debug); + def execute(database: Database, debug: Boolean): result.Status[Unit] = { + database.executeStatement(this, debug) } } diff --git a/src/dbc/scala/dbc/statement/Table.scala b/src/dbc/scala/dbc/statement/Table.scala index 9c09eec1bd..fa61d5d2e6 100644 --- a/src/dbc/scala/dbc/statement/Table.scala +++ b/src/dbc/scala/dbc/statement/Table.scala @@ -1,7 +1,7 @@ /* __ *\ ** ________ ___ / / ___ Scala API ** -** / __/ __// _ | / / / _ | (c) 2003-2006, LAMP/EPFL ** -** __\ \/ /__/ __ |/ /__/ __ | ** +** / __/ __// _ | / / / _ | (c) 2003-2007, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | http://scala-lang.org/ ** ** /____/\___/_/ |_/____/_/ | | ** ** |/ ** \* */ @@ -9,7 +9,7 @@ // $Id:Table.scala 6853 2006-03-20 16:58:47 +0100 (Mon, 20 Mar 2006) dubochet $ -package scala.dbc.statement; +package scala.dbc.statement /** A reference to a table in the database. @@ -18,23 +18,21 @@ package scala.dbc.statement; abstract class Table extends Relation { /** The name of the table in the database. */ - def tableName: String; + def tableName: String /** The name that the table will be called in the enclosing statement. */ - def tableRename: Option[String]; + def tableRename: Option[String] /** A SQL-99 compliant string representation of the relation statement. */ - def sqlString: String = { - "SELECT * FROM " + tableName - } + def sqlString: String = "SELECT * FROM " + tableName /** A SQL-99 compliant string representation of the relation sub- * statement. This only has a meaning inside a query. */ - def sqlInnerString: String = ( + def sqlInnerString: String = tableName + (tableRename match { case None => "" case Some(rename) => " AS " + rename }) - ) + } -- cgit v1.2.3