blob: d7924cf72e30ec8e9293fa4978c3ca7551446ea3 [file] [log] [blame]
/*
* Copyright (c) 1998, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0,
* or the Eclipse Distribution License v. 1.0 which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
*/
// Contributors:
// Oracle - initial API and implementation from Oracle TopLink
package org.eclipse.persistence.testing.models.jpa.proxyauthentication;
import org.eclipse.persistence.tools.schemaframework.*;
public class PhoneNumberTableCreator extends TableCreator {
public PhoneNumberTableCreator() {
setName("PhoneNumberTableCreator");
addTableDefinition(buildPHONENUMBERTable());
}
public static TableDefinition buildPHONENUMBERTable() {
TableDefinition table = new TableDefinition();
table.setName("PROXY_PHONENUMBER");
// SECTION: FIELD
FieldDefinition field = new FieldDefinition();
field.setName("OWNER_ID");
field.setTypeName("NUMERIC");
field.setSize(15);
field.setShouldAllowNull(false );
field.setIsPrimaryKey(true );
field.setUnique(false );
field.setIsIdentity(false );
field.setForeignKeyFieldName("JPA_PROXY_EMPLOYEE.EMP_ID");
table.addField(field);
// SECTION: FIELD
FieldDefinition field1 = new FieldDefinition();
field1.setName("TYPE");
field1.setTypeName("VARCHAR");
field1.setSize(15);
field1.setShouldAllowNull(false );
field1.setIsPrimaryKey(true );
field1.setUnique(false );
field1.setIsIdentity(false );
table.addField(field1);
// SECTION: FIELD
FieldDefinition field2 = new FieldDefinition();
field2.setName("AREA_CODE");
field2.setTypeName("VARCHAR");
field2.setSize(3);
field2.setShouldAllowNull(true );
field2.setIsPrimaryKey(false );
field2.setUnique(false );
field2.setIsIdentity(false );
table.addField(field2);
// SECTION: FIELD
FieldDefinition field3 = new FieldDefinition();
field3.setName("NUMB");
field3.setTypeName("VARCHAR");
field3.setSize(8);
field3.setShouldAllowNull(true );
field3.setIsPrimaryKey(false );
field3.setUnique(false );
field3.setIsIdentity(false );
table.addField(field3);
return table;
}
}