tbrugz avatar tbrugz committed 42f47d4

dumper: SchemaModelScriptDumper: yet more props refactoring

Comments (0)

Files changed (2)

sqldump.template.properties

 #
 # script dump properties
 #
-#sqldump.dumpwithschemaname=true
+#sqldump.schemadump.dumpwithschemaname=true
 #sqldump.schemadump.dumpsynonymastable=false
 #sqldump.schemadump.dumpviewastable=false
 #sqldump.schemadump.dumpmaterializedviewastable=false

src/tbrugz/sqldump/SchemaModelScriptDumper.java

 	@Deprecated static final String PROP_DUMP_SYNONYM_AS_TABLE = "sqldump.dumpsynonymastable";
 	@Deprecated static final String PROP_DUMP_VIEW_AS_TABLE = "sqldump.dumpviewastable";
 	@Deprecated static final String PROP_DUMP_MATERIALIZEDVIEW_AS_TABLE = "sqldump.dumpmaterializedviewastable";
+	@Deprecated static final String PROP_DUMP_WITH_SCHEMA_NAME = "sqldump.dumpwithschemaname";
 
 	//also used by SQLDiff
-	static final String PROP_DUMP_WITH_SCHEMA_NAME = "sqldump.dumpwithschemaname"; //XXX SQLDiff should use this?
+	static final String PROP_SCHEMADUMP_DUMP_WITH_SCHEMA_NAME = PREFIX+".dumpwithschemaname"; //XXX SQLDiff should use this?
 	public static final String PROP_SCHEMADUMP_USECREATEORREPLACE = PREFIX+".usecreateorreplace";
 	public static final String PROP_SCHEMADUMP_QUOTEALLSQLIDENTIFIERS = PREFIX+".quoteallsqlidentifiers";
 
 	static final String PROP_SCHEMADUMP_OUTPUT_OBJECT_WITH_REFERENCING_TABLE = PREFIX+".outputobjectwithreferencingtable";
 	static final String PROP_SCHEMADUMP_FKS_ATEND =  PREFIX+".fks.atend";
 	
-	static final String PREFIX_OUTPATTERN_BYTYPE = "sqldump.outputfilepattern.bytype";
+	static final String PREFIX_OUTPATTERN_BYTYPE = "sqldump.outputfilepattern.bytype."; //XXX
+	static final String PREFIX_OUTPATTERN_MAPTYPE = "sqldump.outputfilepattern.maptype."; //XXX
 	
 	Map<DBObjectType, DBObjectType> mappingBetweenDBObjectTypes = new HashMap<DBObjectType, DBObjectType>();
 	
 		//XXX doSchemaDumpFKs = prop.getProperty(SQLDataDump.PROP_DO_SCHEMADUMP_FKS, "").equals("true");
 		boolean doSchemaDumpFKsAtEnd = Utils.getPropBoolWithDeprecated(prop, PROP_SCHEMADUMP_FKS_ATEND, PROP_DO_SCHEMADUMP_FKS_ATEND, !dumpFKsInsideTable);
 		//XXX doSchemaDumpGrants = prop.getProperty(SQLDataDump.PROP_DO_SCHEMADUMP_GRANTS, "").equals("true");
-		dumpWithSchemaName = Utils.getPropBool(prop, PROP_DUMP_WITH_SCHEMA_NAME, dumpWithSchemaName);
+		dumpWithSchemaName = Utils.getPropBoolWithDeprecated(prop, PROP_SCHEMADUMP_DUMP_WITH_SCHEMA_NAME, PROP_DUMP_WITH_SCHEMA_NAME, dumpWithSchemaName);
 		dumpSynonymAsTable = Utils.getPropBoolWithDeprecated(prop, PROP_SCHEMADUMP_SYNONYM_AS_TABLE, PROP_DUMP_SYNONYM_AS_TABLE, dumpSynonymAsTable);
 		dumpViewAsTable = Utils.getPropBoolWithDeprecated(prop, PROP_SCHEMADUMP_VIEW_AS_TABLE, PROP_DUMP_VIEW_AS_TABLE, dumpViewAsTable);
 		dumpMaterializedViewAsTable = Utils.getPropBoolWithDeprecated(prop, PROP_SCHEMADUMP_MATERIALIZEDVIEW_AS_TABLE, PROP_DUMP_MATERIALIZEDVIEW_AS_TABLE, dumpMaterializedViewAsTable);
 		
 		for(DBObjectType dbtype: DBObjectType.values()) {
 			DBObjectType typeMappedTo = null;
-			String typeMappedToStr = prop.getProperty("sqldump.outputfilepattern.maptype."+dbtype.name());
+			String typeMappedToStr = prop.getProperty(PREFIX_OUTPATTERN_MAPTYPE+dbtype.name());
 			if(typeMappedToStr==null) { continue; }
 			try {
 				typeMappedTo = DBObjectType.valueOf(typeMappedToStr);
 		DBObjectType mappedObjectType = mappingBetweenDBObjectTypes.get(objectType);
 		if(mappedObjectType!=null) { objectType = mappedObjectType; }
 		
-		String outFilePattern = prop.getProperty(PREFIX_OUTPATTERN_BYTYPE+"."+objectType.name());
+		String outFilePattern = prop.getProperty(PREFIX_OUTPATTERN_BYTYPE+objectType.name());
 		if(outFilePattern==null) {
 			outFilePattern = mainOutputFilePattern;
 		}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.