DROP TABLE DATE_BEAN;

CREATE TABLE DATA_TYPE_BEAN
(
	ID Integer ,
        BYTE_ARRAY BINARY(128),
primary key(
	ID 
)
);


CREATE TABLE DATE_BEAN
(
	ID Integer ,
	NAME VARCHAR (128) ,
        DATE_TM DATETIME,
        TIME_SP TIMESTAMP,
        DATE_FD DATE,
        TIME_FD TIME,
primary key(
	ID 
)
);

CREATE TABLE VERSION_BEAN
(
	ID Integer ,
	NAME VARCHAR (128) ,
        LOCK_VERSION INTEGER,
        UPDATE_DT DATETIME,
primary key(
	ID 
)
);

CREATE TABLE DELETE_BEAN
(
	ID Integer ,
	NAME VARCHAR (128) ,
        DELETE_FG BIT,
        DELETE_DT DATETIME,
primary key(
	ID 
)
);

CREATE TABLE DELETE_CHILD
(
	ID Integer ,
        PARENT_ID Integer,
	NAME VARCHAR (128) ,
        DELETE_FG BIT,
        DELETE_DT DATETIME,
primary key(
	ID 
)
);

alter table DELETE_CHILD add constraint fk_DELETE_BEAN_PARENT_ID foreign key (PARENT_ID) references DELETE_BEAN (ID);



