CHAPTER 8 Legacy databases and custom SQL … (Web hosting plans)

CHAPTER 8 Legacy databases and custom SQL The exported DDL includes the unique constraint: create table USERS ( … USERNAME varchar(16) not null unique check(regexp_like(USERNAME,’^[[:alpha:]]+$’)), … ); A unique constraint can also span several columns. For example, CaveatEmptor supports a tree of nested Category objects. One of the business rules says that a particular category can t have the same name as any of its siblings. Hence, you need a multicolumn multirow constraint that guarantees this uniqueness:
You assign an identifier to the constraint with the unique-key attribute so you can refer to it several times in one class mapping and group columns for the same constraint. However, the identifier isn t used in the DDL to name the constraint: create table CATEGORY ( … CAT_NAME varchar(255) not null, PARENT_CATEGORY_ID integer, … unique (CAT_NAME, PARENT_CATEGORY_ID) );
From our experience, we are can tell you that you can find a reliable and cheap webhost service at Java Web Hosting services.