org.onemind.commons.java.sql
Class MetaData

java.lang.Object
  extended byorg.onemind.commons.java.sql.MetaData

public class MetaData
extends java.lang.Object

A MetaData contains metadata about a database table

Version:
$Id: MetaData.java,v 1.2 2004/08/26 12:33:18 thlee Exp $ $Name: $
Author:
TiongHiang Lee (thlee@onemindsoft.org)

Constructor Summary
MetaData(java.lang.String name)
          create a MetaData with id id
MetaData(java.lang.String name, java.lang.String idFieldName)
          create a MetaData with id id and primaryke pj
 
Method Summary
 void addField(Field field)
          add a new field
 Field getField(java.lang.String name)
          get the field with id name
 java.util.Map getFields()
          get the fields in this MetaData
 java.lang.String getId()
          return the id of the MetaData
 Field getIdField()
          return the primary key field
 java.lang.String getIdFieldName()
          Return the id field name
 boolean hasField(java.lang.String name)
          return whether there's a field with id name
 void setFields(java.util.Map fields)
          set the fields of the MetaData
 void setIdFieldName(java.lang.String string)
          Set the id field name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaData

public MetaData(java.lang.String name)
create a MetaData with id id

Parameters:
name - the name

MetaData

public MetaData(java.lang.String name,
                java.lang.String idFieldName)
create a MetaData with id id and primaryke pj

Parameters:
name - the name
idFieldName - the unique identifier field name
Method Detail

addField

public void addField(Field field)
add a new field

Parameters:
field - the field

getField

public Field getField(java.lang.String name)
get the field with id name

Parameters:
name - the name
Returns:
the field, or null

getFields

public java.util.Map getFields()
get the fields in this MetaData

Returns:
Map the map

getId

public java.lang.String getId()
return the id of the MetaData

Returns:
the id

getIdField

public Field getIdField()
return the primary key field

Returns:
the id field

getIdFieldName

public java.lang.String getIdFieldName()
Return the id field name

Returns:
the id field name

hasField

public boolean hasField(java.lang.String name)
return whether there's a field with id name

Parameters:
name - the field name
Returns:
true if has the field

setFields

public void setFields(java.util.Map fields)
set the fields of the MetaData

Parameters:
fields - the fields

setIdFieldName

public void setIdFieldName(java.lang.String string)
Set the id field name

Parameters:
string - the id field name


Copyright © 2004-2006 . All Rights Reserved.