if (!dbType1.equals(SYBASE2)) {
allow_keys.add(dbType1);
}
}
if (keys.size() > 0) {
throw new RepositoryException(
"The following keys used in the 'sqlCreateFiles' and/or 'sqlDropFiles' properties "
+ "are invalid: "
+ keys
+ ". Allowable keys are: "
+ allow_keys
);
}
boolean isDefaultCreate = (getSqlCreateFiles().get(DEFAULT) != null);
boolean isDefaultDrop = (getSqlDropFiles().get(DEFAULT) != null);
// if there are defaults it will always be ok, so just return
if (isDefaultCreate && isDefaultDrop) {
return;
}
// otherwise, check each dbType individually
for (String dbType : dbTypes) {
boolean isCreate = (getSqlCreateFiles().get(dbType) != null);
boolean isDrop = (getSqlDropFiles().get(dbType) != null);
if (!isAllowNoDrop()) {
if (isCreate && !isDrop && !isDefaultDrop) {
throw new RepositoryException(
"Mapping exists for database type "
+ dbType
+ " in property 'sqlCreateFiles', but not in property 'sqlDropFiles', and "
+ "there is no default specified."
);
}
if (isDrop && !isCreate && !isDefaultCreate) {
throw new RepositoryException(
"Mapping exists for database type "
+ dbType
+ " in property 'sqlDropFiles', but not in property 'sqlCreateFiles', and "
+ "there is no default specified."
);