gt:         FieldDefinition field = new FieldDefinition();
context: /*******************************************************************************
   * Copyright (c) 1998, 2013 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 v1.0 and Eclipse Distribution License v. 1.0 
   * which accompanies this distribution. 
   * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
   * and the Eclipse Distribution License is available at 
   * http://www.eclipse.org/org/documents/edl-v10.php.
   *
   * Contributors:
   *     04/30/2009-2.0 Michael O'Brien 
   *       - 266912: JPA 2.0 Metamodel API (part of Criteria API) 
   ******************************************************************************/  
  package org.eclipse.persistence.testing.tests.jpa.metamodel;
  
  
  import org.eclipse.persistence.tools.schemaframework.FieldDefinition;
  import org.eclipse.persistence.tools.schemaframework.TableCreator;
  import org.eclipse.persistence.tools.schemaframework.TableDefinition;
  
  public class MetamodelTableCreator extends TableCreator {
      
      /**
       * 
       * DDL schema cleanup order
  DROP TABLE CMP3_MM_HIST_EMPLOY
  DROP TABLE CMP3_MM_MANUF_MM_HWDES_MAP
  DROP TABLE CMP3_MM_MANUF_MM_HWDES_MAPUC8
  DROP TABLE CMP3_MM_MANUF_MM_HWDES_MAPUC7
  DROP TABLE CMP3_MM_MANUF_MM_HWDES_MAPUC4
  DROP TABLE CMP3_MM_MANUF_MM_HWDES_MAPUC2
  DROP TABLE CMP3_MM_MANUF_MM_HWDES_MAPUC1A
  DROP TABLE CMP3_MM_MANUF_MM_CORPCOMPUTER
  DROP TABLE CMP3_MM_MANUF_MM_COMPUTER
  DROP TABLE CMP3_MM_MANUF_MM_HWDESIGNER
  DROP TABLE CMP3_MM_BOARD_MM_MEMORY
  DROP TABLE CMP3_MM_BOARD_MM_PROC
  DROP TABLE CMP3_MM_COMPUTER_MM_USER
  DROP TABLE CMP3_MM_COMPUTER_MM_BOARD
  DROP TABLE CMP3_MM_BOARD_SEQ
  DROP TABLE CMP3_MM_PERSON_SEQ
  DROP TABLE CMP3_MM_PROC_SEQ
  
  DROP TABLE CMP3_MM_USER
  DROP TABLE CMP3_MM_HWDESIGNER
  DROP TABLE CMP3_MM_MEMORY
  DROP TABLE CMP3_MM_PROC
  DROP TABLE CMP3_MM_ARRAYPROC
  DROP TABLE CMP3_MM_LOCATION
  DROP TABLE CMP3_MM_GALACTIC
  DROP TABLE CMP3_MM_BOARD
  DROP TABLE CMP3_MM_SWDESIGNER
  DROP TABLE CMP3_MM_MANUF
  DROP TABLE CMP3_MM_ENCLOSURE
  DROP TABLE CMP3_MM_COMPUTER
       */
      
      public MetamodelTableCreator() {
          setName("MetamodelProject");
  
          addTableDefinition(buildENCLOSURETable());
          addTableDefinition(buildMANUFACTURERTable());
          addTableDefinition(buildHARDWAREDESIGNERTable());
          addTableDefinition(buildSOFTWAREDESIGNERTable());
          addTableDefinition(buildUSERTable());
          addTableDefinition(buildCOMPUTERTable());
          addTableDefinition(buildBOARDTable());
          addTableDefinition(buildMEMORYTable());        
          addTableDefinition(buildPROCESSORTable());        
          //addTableDefinition(buildVECTORPROCESSORTable());
          //addTableDefinition(buildARRAYPROCESSORTable());
          //addTableDefinition(buildLOCATIONTable());
          addTableDefinition(buildGALACTICPOSITIONTable());
          // Test ms-ms-entity chain with idclass above id
          addTableDefinition(buildMS_MS_Entity_Leaf_Table());
  
          
          // 1:n
          addTableDefinition(buildMANUFACTURER_COMPUTER_JOINTable());
          addTableDefinition(buildMANUFACTURER_CORPCOMPUTER_JOINTable());
          addTableDefinition(buildMANUFACTURER_HARDWAREDESIGNER_JOINTable());
          addTableDefinition(buildMANUFACTURER_HARDWAREDESIGNER_MAPUC1A_JOINTable());
          addTableDefinition(buildMANUFACTURER_HARDWAREDESIGNER_MAPUC2_JOINTable());
          addTableDefinition(buildMANUFACTURER_HARDWAREDESIGNER_MAPUC4_JOINTable());
          addTableDefinition(buildMANUFACTURER_HARDWAREDESIGNER_MAPUC7_JOINTable());
          addTableDefinition(buildMANUFACTURER_HARDWAREDESIGNER_MAPUC8_JOINTable());        
          //addTableDefinition(buildMANUFACTURER_ENCLOSURE_MAPUC9_JOINTable());        
          addTableDefinition(buildMANUFACTURER_HARDWAREDESIGNER_HISTORICAL_JOINTable());        
          addTableDefinition(buildBOARD_MEMORY_JOINTable());
          addTableDefinition(buildBOARD_PROCESSOR_JOINTable());
          addTableDefinition(buildCOMPUTER_BOARD_JOINTable());
          // n:n
          //addTableDefinition(buildCOMPUTER_USER_JOINTable());
          addTableDefinition(buildCMP3_MM_BOARD_SEQTable());
          addTableDefinition(buildCMP3_MM_PERSON_SEQTable());
          addTableDefinition(buildCMP3_MM_MANUF_CMP3_MM_MANUFTable());
      }
   	
  
      public static TableDefinition buildMANUFACTURERTable() {
          TableDefinition table = new TableDefinition();
          table.setName("CMP3_MM_MANUF");
  
          FieldDefinition field = new FieldDefinition();
          field.setName("PERSON_ID");
          field.setTypeName("NUMERIC");
          field.setSize(15);
          field.setShouldAllowNull(false);
          field.setIsPrimaryKey(true);
          field.setUnique(false);
          field.setIsIdentity(true);
          table.addField(field);
  
          FieldDefinition field4 = new FieldDefinition();
          field4.setName("MANUF_VERSION");
          field4.setTypeName("NUMERIC");
          field4.setSize(15);
          field4.setShouldAllowNull(true);
          field4.setIsPrimaryKey(false);
          field4.setUnique(false);
          field4.setIsIdentity(false);
          table.addField(field4);
  
          FieldDefinition field3 = new FieldDefinition();
          field3.setName("NAME");
          field3.setTypeName("VARCHAR");
          field3.setSize(80);
          field3.setShouldAllowNull(true);
          field3.setIsPrimaryKey(false);
          field3.setUnique(false);
          field3.setIsIdentity(false);
          table.addField(field3);
  
  /*        // 1:m does not require a JoinTable - only a JoinColumn
          FieldDefinition field6 = new FieldDefinition();
          field6.setName("EMPLOYER_PERSON_ID");
          field6.setTypeName("NUMERIC");
          field6.setSize(15);
          field6.setShouldAllowNull(false);
          field6.setIsPrimaryKey(false);
          field6.setUnique(false);
          field6.setIsIdentity(false);
          field6.setForeignKeyFieldName("CMP3_MM_HWDESIGNER.PERSON_ID");
          table.addField(field6);        
  */
                  
          // Primitive and Basic type testing
          //ADOUBLEOBJECT, ABIGINTEGEROBJECT, AFLOATOBJECT, MANUF_VERSION, ALONGOBJECT, ASHORT, ABYTEOBJECT, NAME, ABOOLEANOBJECT, ACHAR, ACHARACTEROBJECT, ANINT, AFLOAT, ALONG, ADOUBLE, ASHORTOBJECT, ANINTEGEROBJECT
          //private Boolean aBooleanObject;
          FieldDefinition field71 = new FieldDefinition();
          field71.setName("ABOOLEANOBJECT");
          field71.setTypeName("NUMERIC");
          field71.setSize(2);
          field71.setShouldAllowNull(true);
          field71.setIsPrimaryKey(false);
          field71.setUnique(false);
          field71.setIsIdentity(false);
          table.addField(field71);
  
          //private Byte aByteObject;
          FieldDefinition field72 = new FieldDefinition();
          field72.setName("ABYTEOBJECT");
          field72.setTypeName("NUMERIC");
          field72.setSize(2);
          field72.setShouldAllowNull(true);
          field72.setIsPrimaryKey(false);
          field72.setUnique(false);
          field72.setIsIdentity(false);
          table.addField(field72);
  
          //private Short aShortObject;    
          FieldDefinition field73 = new FieldDefinition();
          field73.setName("ASHORTOBJECT");
          field73.setTypeName("NUMERIC");
          field73.setSize(15);
          field73.setShouldAllowNull(true);
          field73.setIsPrimaryKey(false);
          field73.setUnique(false);
          field73.setIsIdentity(false);
          table.addField(field73);
  
          //private Integer anIntegerObject;
          FieldDefinition field74 = new FieldDefinition();
          field74.setName("ANINTEGEROBJECT");
          field74.setTypeName("NUMERIC");
          field74.setSize(15);
          field74.setShouldAllowNull(true);
          field74.setIsPrimaryKey(false);
          field74.setUnique(false);
          field74.setIsIdentity(false);
          table.addField(field74);
  
          //private Long aLongObject;
          FieldDefinition field75 = new FieldDefinition();
          field75.setName("ALONGOBJECT");
          field75.setTypeName("NUMERIC");
          field75.setSize(18);
          field75.setShouldAllowNull(true);
          field75.setIsPrimaryKey(false);
          field75.setUnique(false);
          field75.setIsIdentity(false);
          table.addField(field75);
          
          //private BigInteger aBigIntegerObject;    
          FieldDefinition field76 = new FieldDefinition();
          field76.setName("ABIGINTEGEROBJECT");
          field76.setTypeName("NUMERIC");
          field76.setSize(18);
          field76.setShouldAllowNull(true);
          field76.setIsPrimaryKey(false);
          field76.setUnique(false);
          field76.setIsIdentity(false);
          table.addField(field76);
  
          //private Float aFloatObject;
          FieldDefinition field77 = new FieldDefinition();
          field77.setName("AFLOATOBJECT");
          field77.setTypeName("NUMERIC");
          field77.setSize(18);
          field77.setShouldAllowNull(true);
          field77.setIsPrimaryKey(false);
          field77.setUnique(false);
          field77.setIsIdentity(false);
          table.addField(field77);
  
          //private Double aDoubleObject;
          FieldDefinition field78 = new FieldDefinition();
          field78.setName("ADOUBLEOBJECT");
          field78.setTypeName("NUMERIC");
          field78.setSize(18);
          field78.setShouldAllowNull(true);
          field78.setIsPrimaryKey(false);
          field78.setUnique(false);
          field78.setIsIdentity(false);
          table.addField(field78);
  
          //private Character aCharacterObject;        
          FieldDefinition field79 = new FieldDefinition();
          field79.setName("ACHARACTEROBJECT");
          field79.setTypeName("VARCHAR");
          field79.setSize(80);
          field79.setShouldAllowNull(true);
          field79.setIsPrimaryKey(false);
          field79.setUnique(false);
          field79.setIsIdentity(false);
          table.addField(field79);
  
          //private boolean aBoolean;
          FieldDefinition field80 = new FieldDefinition();
          field80.setName("ABOOLEAN");
          field80.setTypeName("NUMERIC");
          field80.setSize(2);
          field80.setShouldAllowNull(true);
          field80.setIsPrimaryKey(false);
          field80.setUnique(false);
          field80.setIsIdentity(false);
          table.addField(field80);
  
          //private byte aByte;
          FieldDefinition field81 = new FieldDefinition();
          field81.setName("ABYTE");
          field81.setTypeName("NUMERIC");
          field81.setSize(15);
          field81.setShouldAllowNull(true);
          field81.setIsPrimaryKey(false);
          field81.setUnique(false);
          field81.setIsIdentity(false);
          table.addField(field81);
  
          //private short aShort;    
          FieldDefinition field82 = new FieldDefinition();
          field82.setName("ASHORT");
          field82.setTypeName("NUMERIC");
          field82.setSize(15);
          field82.setShouldAllowNull(true);
          field82.setIsPrimaryKey(false);
          field82.setUnique(false);
          field82.setIsIdentity(false);
          table.addField(field82);
  
          //private int anInt;
          FieldDefinition field83 = new FieldDefinition();
          field83.setName("ANINT");
          field83.setTypeName("NUMERIC");
          field83.setSize(15);
          field83.setShouldAllowNull(true);
          field83.setIsPrimaryKey(false);
          field83.setUnique(false);
          field83.setIsIdentity(false);
          table.addField(field83);
          
          //private long aLong;
          FieldDefinition field84 = new FieldDefinition();
          field84.setName("ALONG");
          field84.setTypeName("NUMERIC");
          field84.setSize(18);
          field84.setShouldAllowNull(true);
          field84.setIsPrimaryKey(false);
          field84.setUnique(false);
          field84.setIsIdentity(false);
          table.addField(field84);
          
          //private float aFloat;
          FieldDefinition field85 = new FieldDefinition();
          field85.setName("AFLOAT");
          field85.setTypeName("NUMERIC");
          field85.setSize(18);
          field85.setShouldAllowNull(true);
          field85.setIsPrimaryKey(false);
          field85.setUnique(false);
          field85.setIsIdentity(false);
          table.addField(field85);
          
          //private double aDouble;
          FieldDefinition field86 = new FieldDefinition();
          field86.setName("ADOUBLE");
          field86.setTypeName("NUMERIC");
          field86.setSize(18);
          field86.setShouldAllowNull(true);
          field86.setIsPrimaryKey(false);
          field86.setUnique(false);
          field86.setIsIdentity(false);
          table.addField(field86);
          
          //private char aChar;
          FieldDefinition field87 = new FieldDefinition();
          field87.setName("ACHAR");
          field87.setTypeName("VARCHAR");
          field87.setSize(2);
          field87.setShouldAllowNull(true);
          field87.setIsPrimaryKey(false);
          field87.setUnique(false);
          field87.setIsIdentity(false);
          table.addField(field87);
          
          //public enum anEnum { one, two, three};
  /*        FieldDefinition field88 = new FieldDefinition();
          field88.setName("ANENUM");
          field88.setTypeName("NUMERIC");
          field88.setSize(15);
          field88.setShouldAllowNull(true);
          field88.setIsPrimaryKey(false);
          field88.setUnique(false);
          field88.setIsIdentity(false);
          table.addField(field88);
    */      
  
          //private BigInteger aBigIntegerObject;    
          FieldDefinition field90 = new FieldDefinition();
          field90.setName("ABIGDECIMALOBJECT");
          field90.setTypeName("NUMERIC");
          field90.setSize(31);
          field90.setShouldAllowNull(true);
          field90.setIsPrimaryKey(false);
          field90.setUnique(false);
          field90.setIsIdentity(false);
          table.addField(field90);
  
          return table;
      }
  
      public static TableDefinition buildHARDWAREDESIGNERTable() {
          TableDefinition table = new TableDefinition();
          table.setName("CMP3_MM_HWDESIGNER");
  
          /*FieldDefinition field_id2 = new FieldDefinition();
          field_id2.setName("DESIGNER_ID");
          field_id2.setTypeName("NUMERIC");
          field_id2.setSize(15);
          field_id2.setShouldAllowNull(false);
          field_id2.setIsPrimaryKey(true);
          field_id2.setUnique(false);
          field_id2.setIsIdentity(true);
          table.addField(field_id2);*/
  
  