home | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (Update.scala)

This example Scala source code file (Update.scala) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

list, none, none, option, set, some, status, status, string, string, update, update, where

The Scala Update.scala source code

/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2003-2011, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |                                         **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */



package scala.dbc
package statement;


import scala.dbc.statement.expression._;

/** An update of the state of a table. */
@deprecated(DbcIsDeprecated, "2.9.0") case class Update (
  updateTarget: String,
  setClauses: List[SetClause],
  whereClause: Option[Expression]
) extends Status {
  

  /** A SQL-99 compliant string representation of the select statement. */
  def sqlString: String = (
    "UPDATE " +
    updateTarget +
    " SET " + setClauses.map(sc=>sc.sqlString).mkString("",", ","") +
    (whereClause match {
      case None => ""
      case Some(expr) => " WHERE " + expr.sqlString
    })
  );
  
  /** The name of the table that should be updated. */
  //def updateTarget: String;
  
  /** The data that will be added tot he table. */
  //def setClauses: List[SetClause];
  
  /** Defines condition that must be true in the tuples that will be updated.
    * This value expression must return a boolean or boolean-compatible
    * value. */
  //def whereClause: Option[scala.dbc.statement.expression.Expression];
  
}

Other Scala examples (source code examples)

Here is a short list of links related to this Scala Update.scala source code file:



my book on functional programming

 

new blog posts

 

Copyright 1998-2019 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.