Package org.onemind.commons.java.sql
Class MetaData
- java.lang.Object
-
- org.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)
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map
_fields
the fields *private java.lang.String
_idFieldName
the primary key field name *private java.lang.String
_name
the name *
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addField(Field field)
add a new fieldField
getField(java.lang.String name)
get the field with id namejava.util.Map
getFields()
get the fields in this MetaDatajava.lang.String
getId()
return the id of the MetaDataField
getIdField()
return the primary key fieldjava.lang.String
getIdFieldName()
Return the id field nameboolean
hasField(java.lang.String name)
return whether there's a field with id namevoid
setFields(java.util.Map fields)
set the fields of the MetaDatavoid
setIdFieldName(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
-
-