use of org.eclipse.persistence.tools.schemaframework.SchemaManager in project eclipselink by eclipse-ee4j.
the class EntityManagerSetupImpl method writeMetadataDDLToScript.
/**
* INTERNAL:
* Generate and write DDL from the persistence unit metadata to scripts.
*/
protected void writeMetadataDDLToScript(TableCreationType tableCreationType, Map props, DatabaseSessionImpl session, ClassLoader classLoader) {
SchemaManager mgr = new SchemaManager(session);
// Set the create database schemas flag on the schema manager.
String createSchemas = getConfigPropertyAsString(SCHEMA_GENERATION_CREATE_DATABASE_SCHEMAS, props);
mgr.setCreateDatabaseSchemas(createSchemas != null && createSchemas.equalsIgnoreCase("true"));
writeDDLToFiles(mgr, getConfigPropertyAsString(PersistenceUnitProperties.APP_LOCATION, props), getConfigProperty(SCHEMA_GENERATION_SCRIPTS_CREATE_TARGET, props), getConfigProperty(SCHEMA_GENERATION_SCRIPTS_DROP_TARGET, props), tableCreationType, props);
}
use of org.eclipse.persistence.tools.schemaframework.SchemaManager in project eclipselink by eclipse-ee4j.
the class ComicsPopulateAndQueryTestSuite method setUp.
@BeforeClass
public static void setUp() {
session = ComicsConfigTestSuite.buildComicsSession();
assertNotNull(session);
dynamicHelper = new DynamicHelper(session);
SchemaManager sm = new SchemaManager(session);
sm.replaceDefaultTables();
sm.replaceSequences();
}
use of org.eclipse.persistence.tools.schemaframework.SchemaManager in project eclipselink by eclipse-ee4j.
the class InsuranceORStoredProcedureSystem method createTables.
/**
* Also creates the procs.
*/
@Override
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()) {
}
}
use of org.eclipse.persistence.tools.schemaframework.SchemaManager in project eclipselink by eclipse-ee4j.
the class UOWSystem method createTables.
@Override
public void createTables(DatabaseSession session) {
SchemaManager schemaManager = new SchemaManager(session);
schemaManager.replaceObject(Contact.tableDefinition());
schemaManager.replaceObject(Person.tableDefinition());
schemaManager.replaceObject(MailAddress.tableDefinition());
schemaManager.replaceObject(Weather.tableDefinition());
schemaManager.replaceObject(ConcurrentAddress.tableDefinition());
schemaManager.replaceObject(ConcurrentPerson.tableDefinition());
schemaManager.replaceObject(ConcurrentProject.tableDefinition());
schemaManager.replaceObject(ConcurrentPhoneNumber.tableDefinition());
schemaManager.replaceObject(MutableAttributeObject.tableDefinition());
schemaManager.createSequences();
}
use of org.eclipse.persistence.tools.schemaframework.SchemaManager in project eclipselink by eclipse-ee4j.
the class MapCollectionsSystem method createTables.
@Override
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();
}
Aggregations