Class 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 *
    • Constructor Summary

      Constructors 
      Constructor Description
      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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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
    • Field Detail

      • _fields

        private java.util.Map _fields
        the fields *
      • _name

        private java.lang.String _name
        the name *
      • _idFieldName

        private java.lang.String _idFieldName
        the primary key 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 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