{
unit.excludeUnlistedClasses(Boolean.FALSE);
PersistenceCommonDescriptor descriptor = (PersistenceCommonDescriptor) unit.up();
if (new SingleVersion(descriptor.getVersion()).compareTo(new SingleVersion("2.1")) >= 0)
{
PropertiesCommon properties = unit.getOrCreateProperties();
String schemaGenerationPropertyValue = getSchemaGenerationPropertyValue(ds.getSchemaGenerationType());
if (!Strings.isNullOrEmpty(schemaGenerationPropertyValue))
{
properties.createProperty().name("javax.persistence.schema-generation.database.action")
.value(schemaGenerationPropertyValue);
properties.createProperty().name("javax.persistence.schema-generation.scripts.action")
.value(schemaGenerationPropertyValue);
String createDdlFileName = project == null ? "create.ddl" : getProjectName(project) + "Create.ddl";
properties.createProperty().name("javax.persistence.schema-generation.scripts.create-target")
.value(createDdlFileName);
String dropDdlFileName = project == null ? "drop.ddl" : getProjectName(project) + "Drop.ddl";
properties.createProperty().name("javax.persistence.schema-generation.scripts.drop-target")
.value(dropDdlFileName);
}
}
return unit;
}