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

## scone.netobjects
Class Schema

    java.lang.Object
      scone.netobjects.Schema

    public class Schema

extends java.lang.Object

represents the table definitions of the database restrictions for the sql definition file:

- Table and column definitions must start in a new line.
- Column definitions must be no more than one line.
- There must be exactly one space between CREATE and TABLE or PRIMARY and KEY.
- '#' and ';' will be interpreted as the beginning of a comment, even if they are qouted!
- Default values may not contain '"' or '\'' or ';' or '#' or " primary " or "auto_increment"
- Default values must be the last item in a column definition. They must be literal.
- Rows in a table definition starting with "index " or ")" will be ignored.
- There must be a PRIMARY KEY defined. If the primary key is composed from multiple columns, use a PRIMARY KEY (col_name,...) statement after the columns have been defined.
- If there is an AUTO_INCREMENT column it should be the PRIMARY KEY. A secondary key can be defined using the KEY (col_name,...) statement after the columns have been defined. A secondary key may only be defined if an AUTO_INCREMENT PRIMARY KEY has been defined.
- At most one composed key may be defined.
- Column names are case-sensitive!

Author:
  Volkert Buchmann

Field Summary
`static int` | `BLOB`
`static int` | `FIELD`
`static java.lang.String` | `fileName`
`static int` | `GENERATED`
`static int` | `KEY`
`static int` | `NUMBER`
`static int` | `STRING`

Constructor Summary
`Schema()`

Method Summary
`static int` | `convertType(java.lang.String type)` converts the sql column type into a netobject field type exists the application if an unknown column type is found.
`int` | `count(java.lang.String line, java.lang.String subject)` returns the count of subject in line count("abcbcde","c")==2
`static void` | `initialize(DBTableAdapter adapter)` initializes a DBTableAdapter fills the internal definition tables of the adapter with the values read from the sql definition
`static void` | `main(java.lang.String[] args)`
`void` | `parseSqlSource()` parses the sql file

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

Field Detail

### fileName

    public static final java.lang.String fileName

See Also:
  Constant Field Values

### STRING

    public static final int STRING

See Also:
  Constant Field Values

### NUMBER

    public static final int NUMBER

See Also:
  Constant Field Values

### BLOB

    public static final int BLOB

See Also:
  Constant Field Values

### GENERATED

    public static final int GENERATED

See Also:
  Constant Field Values

### KEY

    public static final int KEY

See Also:
  Constant Field Values

### FIELD

    public static final int FIELD

See Also:
  Constant Field Values

Constructor Detail

### Schema

    public Schema()

Method Detail

### initialize

    public static void initialize(DBTableAdapter adapter)

  initializes a DBTableAdapter fills the internal definition tables of the adapter with the values read from the sql definition

### main

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

### convertType

    public static int convertType(java.lang.String type)

  converts the sql column type into a netobject field type exists the application if an unknown column type is found.

### count

    public int count(java.lang.String line,
                     java.lang.String subject)

  returns the count of subject in line count("abcbcde","c")==2

### parseSqlSource

    public void parseSqlSource()

  parses the sql file

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