View source | View content page | Page history | Printable version   

Projects:DBSourceManager/Schema

Contents

Summary

This is the definition of the database schema that DBSourceManager interprets.

Elements

Database model

database

The database element. This element contains the definition of all the database structure objects.

attributes

name
The name of the database

children

table 
any number.
sequence 
any number.
view
any number.
function
any number.
trigger
any number.

table

This element describes a database table.

attributes

name 
The name of the table.
primaryKey 
The name of the primary key constraint.

children

column 
any number.
foreign-key 
any number.
index 
any number.
unique 
any number.
check 
any number.

column

This element describes a table column.

attributes

name 
The name of this column.
primaryKey 
Whether this is a primary key column.
required 
Whether this is a required column, i.e. a column that is not allowed to contain NULL values. Note that primary key columns are not automatically required.
type 
The JDBC type of the column. This will be automatically translated to a type native to the database.
size 
The JDBC size specification of the column. This is type specific. For types that have a length (such as VARCHAR), specify a single number specifying this length. For types that have precision and scale (such as NUMERIC), specify a pair of values "precision,scale".
default 
The default value of the column if any. Do not specify this attribute unless the column shall have a default value as an empty attribute value will be passed as an empty string (not NULL) to the database. This value is passed as is to the database, though you don't need to quote it for e.g. string values. This value may also be a database function e.g. SYSDATE.
autoIncrement 
Whether this column is an identity value, i.e. it's value is automatically defined by the database
description 
The column description

foreign-key

This element describes a foreign key of this table.

attributes

name 
The name of this foreign key:
onUpdate 
Specifies the action to perform when the value in the referenced column in the foreign table is changed: cascade Change the value of the local column accordingly. setnull Set the local column to NULL which effectively removes this specific foreign key relationship. restrict Different databases may interpret this value differently, but usually it is synonymous with none. none The value of the local column remains unchanged.
onDelete 
Specifies the action to perform when the referenced row in the foreign table is deleted: cascade Delete the local row. setnull Set the local column to NULL which effectively removes this specific foreign key relationship. restrict Different databases may interpret this value differently, but usually it is synonymous with none. none The value of the local column remains unchanged.

children

reference 
any number.

reference

This element describes a foreign key reference.

attributes

local 
The name of the column in the current table.
foreign 
The name of the column in the foreign table.

index

This element describes an index of this table.

attributes

name 
The name of this index.
unique 
Whether this index is unique.

children

index-column 
any number.

index-column

This element describes an index column.

attributes

name 
The name of the column in the current table.

unique

This element describes an unique constraint of this table.

attributes

name 
The name of this unique constraint.

children

unique-column 
any number.

unique-column

This element describes an unique column.

attributes

name 
The name of the column in the current table.

check

This element describes a check constraint of the current table.

attributes

name 
The name of this check constraint.
condition 
The condition expression that this table must satisfy. Deprecated, use the element text.

text

The condition expression that this table must satisfy.

sequence

This element describes a database sequence.

attributes

name 
The name of this sequence.
start 
The number from this sequence starts.
increment 
The number that this sequence increments every request.

view

This element describes a database view.

attributes

name 
The name of this view.

text

The SQL sentence that defines the columns and the data that this view request from the database. The SQL syntax used is the Oracle SQL syntax.

function

This element describes a database stored function or procedure.

attributes

name 
The name of this function of procedure.
type 
The JDBC type that this function returns. This will be automatically translated to a type native to the database. if type is NULL it is a procedure that does not return any value.

children

parameter 
any number.
body 
The text of this element defines the PL/SQL code of this function or procedure. The PL/SQL syntax used is the Oracle PL/SQL syntax.

parameter

This element describes a function parameter.

attributes

name 
The name of this parameter.
type 
The JDBC type of this parameter. This will be automatically translated to a type native to the database.
mode 
The mode of this parameter: in for input parameters, out for output parameters.
default 
The default value of the parameter if any. Do not specify this attribute unless the parameter shall have a default value when an invocation to this function does not specify this parameter value. This value is passed as is to the database, though you don't need to quote it for e.g. string values. This value may also be a database function e.g. SYSDATE.

trigger

This element describes a database trigger.

attributes

name 
The name of this trigger.
table 
The name of the table of the current database this trigger is associated.
fires 
The event that fires the execution of this trigger: before the trigger is executed before the table associated is modified, after the trigger is executed after the table associated is modified.
insert 
Whether this trigger is executed when inserting records in the associated table.
update 
Whether this trigger is executed when updating records in the associated table.
delete 
Whether this trigger is executed when deleting records in the associated table.
foreach 
Defines how many times this trigger is executed: row the trigger is executed for each record that is modified of the associated table. statement the trigger is executed for each SQL statement that modifies the associated table.

children

body 
The text of this element defines the PL/SQL code of this trigger. The PL/SQL syntax used is the Oracle PL/SQL syntax.

Retrieved from "http://wiki.openbravo.com/wiki/Projects:DBSourceManager/Schema"

This page has been accessed 5,734 times. This page was last modified on 8 June 2012, at 05:27. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.