Skip to content

Commit

Permalink
Added option for analyzing data model via CLI
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.code.sf.net/p/jailer/code/trunk@1164 3dd849cd-670e-4645-a7cd-dd197c8d0e81
  • Loading branch information
rwisser committed Mar 30, 2017
1 parent 9438e75 commit a191871
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/net/sf/jailer/datamodel/Association.java
Original file line number Diff line number Diff line change
Expand Up @@ -479,15 +479,15 @@ public DataModel getDataModel() {
*/
public Map<Column, Column> createSourceToDestinationKeyMapping() {
String[] equations = getUnrestrictedJoinCondition().trim().replaceAll("\\(|\\)", " ")
.split(" *\\b(a|A)(n|N)(d|D)\\b *");
.split("\\s*\\b(a|A)(n|N)(d|D)\\b\\s*");
Map<Column, Column> mapping = new HashMap<Column, Column>();
for (String equation: equations) {
String hs[] = equation.split(" *= *");
String hs[] = equation.split("\\s*=\\s*");
if (hs.length != 2) {
return Collections.emptyMap();
}
String lhs[] = hs[0].split(" *\\. *");
String rhs[] = hs[1].split(" *\\. *");
String lhs[] = hs[0].split("\\s*\\.\\s*");
String rhs[] = hs[1].split("\\s*\\.\\s*");
if (lhs.length != 2 || rhs.length != 2 || lhs[0].length() != 1 || rhs[0].length() != 1) {
return Collections.emptyMap();
}
Expand Down

0 comments on commit a191871

Please sign in to comment.