| /* |
| * 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.spatial.jgeometry; |
| |
| public class JGeometryTableCreator extends org.eclipse.persistence.tools.schemaframework.TableCreator { |
| |
| public JGeometryTableCreator(){ |
| buildSimpleSpatialTable(); |
| } |
| |
| protected void buildSimpleSpatialTable() { |
| org.eclipse.persistence.tools.schemaframework.TableDefinition tabledefinition = new org.eclipse.persistence.tools.schemaframework.TableDefinition(); |
| |
| // SECTION: TABLE |
| tabledefinition.setName("SIMPLE_SPATIAL"); |
| |
| // SECTION: FIELD |
| org.eclipse.persistence.tools.schemaframework.FieldDefinition field = new org.eclipse.persistence.tools.schemaframework.FieldDefinition(); |
| field.setName("GID"); |
| field.setTypeName("NUMERIC"); |
| field.setSize(15); |
| field.setShouldAllowNull(false); |
| field.setIsPrimaryKey(true); |
| field.setUnique(false); |
| field.setIsIdentity(true); |
| tabledefinition.addField(field); |
| |
| // SECTION: FIELD |
| org.eclipse.persistence.tools.schemaframework.FieldDefinition field1 = new org.eclipse.persistence.tools.schemaframework.FieldDefinition(); |
| field1.setName("GEOMETRY"); |
| field1.setTypeName("MDSYS.SDO_GEOMETRY"); |
| field1.setShouldAllowNull(true); |
| field1.setIsPrimaryKey(false); |
| field1.setUnique(false); |
| field1.setIsIdentity(false); |
| tabledefinition.addField(field1); |
| |
| addTableDefinition(tabledefinition); |
| } |
| } |