public void createTables(DatabaseSession session) { dropTableConstraints(session); new InheritanceTableCreator().replaceTables(session); SchemaManager schemaManager = new SchemaManager(session); if (session.getLogin().getPlatform().isOracle()) { schemaManager.replaceObject(Computer.oracleView()); schemaManager.replaceObject(Vehicle.oracleView()); } else if (session.getLogin().getPlatform().isSybase()) { schemaManager.replaceObject(Computer.sybaseView()); schemaManager.replaceObject(Vehicle.sybaseView()); // CREATE VIEW statement was added in MySQL 5.0.1. Uncomment it when we support MySQL 5 // } else if (session.getLogin().getPlatform().isMySQL()) { // schemaManager.replaceObject(Computer.sybaseView()); // schemaManager.replaceObject(Vehicle.mySQLView()); } }
/** Also creates the procs. */ public void createTables(DatabaseSession session) { super.createTables(session); org.eclipse.persistence.internal.databaseaccess.DatabasePlatform platform = session.getLogin().getPlatform(); SchemaManager schema = new SchemaManager((session)); if (platform.isSQLServer()) {} if (platform.isSybase() || platform.isSQLAnywhere()) {} if (platform.isOracle()) { schema.replaceObject(buildOracleStoredProcedureInsertPolicyHolders()); schema.replaceObject(buildOracleStoredProcedureReadFromPolicyHolders()); schema.replaceObject(buildOracleStoredProcedureDeletePolicyHolders()); } if (platform.isDB2()) {} }
public void createTables(DatabaseSession session) { SchemaManager schemaManager = new SchemaManager(session); schemaManager.replaceObject(LockInCache.tableDefinition()); schemaManager.replaceObject(LockInObject.tableDefinition()); schemaManager.replaceObject(TimestampInObject.tableDefinition()); schemaManager.replaceObject(TimestampInAggregateObject.tableDefinition()); schemaManager.replaceObject(LockInAggregateObject.tableDefinition()); schemaManager.replaceObject(TimestampInCache.tableDefinition()); schemaManager.replaceObject(ChangedRow.tableDefinition()); schemaManager.createSequences(); new RockBandTableCreator().replaceTables(session); new AnimalTableCreator().replaceTables(session); }
public void createTables(DatabaseSession session) { SchemaManager schemaManager = new SchemaManager(session); // Start Build fieldTypes schemaManager.buildFieldTypes(Dist_Employee.tableDefinition()); schemaManager.buildFieldTypes(Company.tableDefinition()); schemaManager.buildFieldTypes(Item.tableDefinition()); // end build fieldTypes // start drop constraints try { schemaManager.dropConstraints(Dist_Employee.tableDefinition()); schemaManager.dropConstraints(Company.tableDefinition()); schemaManager.dropConstraints(Item.tableDefinition()); } catch (org.eclipse.persistence.exceptions.DatabaseException dbE) { // ignore } // end drop constraints // start replace tables schemaManager.replaceObject(Dist_Employee.tableDefinition()); schemaManager.replaceObject(Company.tableDefinition()); schemaManager.replaceObject(Item.tableDefinition()); // end replace tables // start create constraints schemaManager.createConstraints(Dist_Employee.tableDefinition()); schemaManager.createConstraints(Company.tableDefinition()); schemaManager.createConstraints(Item.tableDefinition()); // end create constraints schemaManager.createSequences(); }
public void createTables(DatabaseSession session) { SchemaManager schemaManager = new SchemaManager(session); schemaManager.replaceObject(DirectEntityMapHolder.tableDefinition()); schemaManager.replaceObject(DirectEntityMapHolder.relationTableDefinition()); schemaManager.replaceObject(DirectEntity1MMapHolder.tableDefinition()); schemaManager.replaceObject(EntityMapValue.tableDefinition()); schemaManager.replaceObject(AggregateEntityMapHolder.tableDefinition()); schemaManager.replaceObject(AggregateEntityMapHolder.relationTableDefinition()); schemaManager.replaceObject(EntityEntityMapHolder.tableDefinition()); schemaManager.replaceObject(EntityEntityMapHolder.relationTableDefinition()); schemaManager.replaceObject(EntityMapKey.tableDefinition()); schemaManager.replaceObject(DirectDirectMapHolder.tableDefinition()); schemaManager.replaceObject(DirectDirectMapHolder.relationTableDefinition()); schemaManager.replaceObject(AggregateDirectMapHolder.tableDefinition()); schemaManager.replaceObject(AggregateDirectMapHolder.relationTableDefinition()); schemaManager.replaceObject(EntityDirectMapHolder.tableDefinition()); schemaManager.replaceObject(EntityDirectMapHolder.relationTableDefinition()); schemaManager.replaceObject(AggregateAggregateMapHolder.tableDefinition()); schemaManager.replaceObject(AggregateAggregateMapHolder.relationTableDefinition()); schemaManager.replaceObject(DirectAggregateMapHolder.tableDefinition()); schemaManager.replaceObject(DirectAggregateMapHolder.relationTableDefinition()); schemaManager.replaceObject(EntityAggregateMapHolder.tableDefinition()); schemaManager.replaceObject(EntityAggregateMapHolder.relationTableDefinition()); schemaManager.replaceObject(DEOTMMapValue.tableDefinition()); schemaManager.replaceObject(AggregateEntity1MMapHolder.tableDefinition()); schemaManager.replaceObject(AEOTMMapValue.tableDefinition()); schemaManager.replaceObject(EntityEntity1MMapHolder.tableDefinition()); schemaManager.replaceObject(EEOTMMapValue.tableDefinition()); schemaManager.replaceObject(DirectEntityU1MMapHolder.tableDefinition()); schemaManager.replaceObject(AggregateEntityU1MMapHolder.tableDefinition()); schemaManager.replaceObject(EntityEntityU1MMapHolder.tableDefinition()); schemaManager.createSequences(); }