edu.upenn.crimson.io
Class Models

java.lang.Object
  extended by edu.upenn.crimson.io.Models

public class Models
extends java.lang.Object

Functions related to the MODELS table.

Version:
$Id: Models.java,v 1.24 2009/07/16 16:19:52 fisher Exp $
Notes:
Should see if can optimize db access by maintaining one Statement that is created every time a database connection is made.

Constructor Summary
Models()
           
 
Method Summary
static boolean dbContains(java.lang.String id)
          This will return true if a model exists in MODELS with an id equal to 'id'.
static boolean delete(java.lang.String id)
          Removes a model from the database.
static void loadAll()
          This will load all models from the MODELS table.
static void save(Model model)
          This will publish the specified model to the MODELS table in the current database.
 java.lang.String toString()
          Returns the non-CLOB columns in the MODELS table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Models

public Models()
Method Detail

loadAll

public static void loadAll()
This will load all models from the MODELS table.


save

public static void save(Model model)
This will publish the specified model to the MODELS table in the current database. This will replace any model object with the same name, already in the table.


delete

public static boolean delete(java.lang.String id)
Removes a model from the database.


dbContains

public static boolean dbContains(java.lang.String id)
This will return true if a model exists in MODELS with an id equal to 'id'.


toString

public java.lang.String toString()
Returns the non-CLOB columns in the MODELS table. Each table record will be separated by a '\n' in the output.

Overrides:
toString in class java.lang.Object



Copyright 2006 Stephen Fisher, Susan Davidson, and Junhyong Kim, University of Pennsylvania.