Package org.onemind.commons.java.sql
Class MetaData
- java.lang.Object
-
- org.onemind.commons.java.sql.MetaData
-
public class MetaData extends java.lang.ObjectA 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)
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map_fieldsthe fields *private java.lang.String_idFieldNamethe primary key field name *private java.lang.String_namethe name *
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddField(Field field)add a new fieldFieldgetField(java.lang.String name)get the field with id namejava.util.MapgetFields()get the fields in this MetaDatajava.lang.StringgetId()return the id of the MetaDataFieldgetIdField()return the primary key fieldjava.lang.StringgetIdFieldName()Return the id field namebooleanhasField(java.lang.String name)return whether there's a field with id namevoidsetFields(java.util.Map fields)set the fields of the MetaDatavoidsetIdFieldName(java.lang.String string)Set the id field name
-
-
-
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 nameidFieldName- 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
-
-