: Class ColumnGroup

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.mortbay.JDBC
Class ColumnGroup

    java.lang.Object
      |
      +--com.mortbay.JDBC.ColumnGroup

Direct Known Subclasses:
  Key, Table

public class ColumnGroup
extends java.lang.Object

Group of SQL column definitions

This class represents a named collection of column definitions, which may be used to define a table, multi-field key or any arbitrary grouping of columns.

Support is provided for formating strings and values against these groupings for the generation of various SQL statements.

#### Notes

#### Usage

Version:
  $Id: ColumnGroup.java,v 2.2 1999/09/22 15:08:40 gregw Exp $
Author:
  Jan Bartel

Field Summary
`Column[]` | `columns`

Constructor Summary
`ColumnGroup(java.lang.String name, Column[] columns)`

Method Summary
`Column` | `column(java.lang.String name)` Return column by name
`java.lang.String` | `getName()` Get the group name
`int` | `index(java.lang.String column)` Return the index of a column
`static void` | `main(java.lang.String[] args)`
`java.lang.String` | `toString()` Convert column group to String.
`java.lang.String` | `toString(java.lang.Object[] values)` Convert column group to value String.
`java.lang.String` | `toString(java.lang.Object[] values, java.lang.String separator)` Convert column group to value String.
`java.lang.String` | `toValuesString(java.lang.Object[] values)` Convert column group to values only String.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### columns

    public final Column[] columns

Constructor Detail

### ColumnGroup

    public ColumnGroup(java.lang.String name,
                       Column[] columns)

Method Detail

### column

    public Column column(java.lang.String name)

  Return column by name
  Parameters:
    `name` - Name of the column
  Returns:
    The column

### index

    public int index(java.lang.String column)

  Return the index of a column
  Parameters:
    `column` - the name of the column
  Returns:
    The index of the column

### toString

    public java.lang.String toString()

  Convert column group to String. Format as coma separated list of column names e.g. "AAA, BBB, CCC"
  Overrides:
    toString in class java.lang.Object

### toString

    public java.lang.String toString(java.lang.Object[] values)

  Convert column group to value String. Format as coma separated list of column values e.g. "AAA=1, BBB=2, CCC=3"

### getName

    public java.lang.String getName()

  Get the group name
  Returns:

### toString

    public java.lang.String toString(java.lang.Object[] values,
                                     java.lang.String separator)

  Convert column group to value String. Format as separated list of column values e.g. "AAA=1BBB=2CCC=3"

### toValuesString

    public java.lang.String toValuesString(java.lang.Object[] values)

  Convert column group to values only String. Format as separated list of column values e.g. "1, 2, 3"

### main

    public static void main(java.lang.String[] args)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD