-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
#24 Implement inner field migration, refactor classes
- Loading branch information
Showing
20 changed files
with
586 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/com/example/postgresneo4jmigrationtool/model/InnerField.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.example.postgresneo4jmigrationtool.model; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
|
||
import java.util.List; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
public class InnerField { | ||
|
||
private Node source; | ||
private String fieldName; | ||
private String valueType; | ||
private List<Object> values; | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder result = new StringBuilder(); | ||
result.append("["); | ||
for (Object value : values) { | ||
switch (valueType) { | ||
case "integer", "bigint", "bigserial" -> result.append(value); | ||
default -> { | ||
result.append("\""); | ||
result.append(value); | ||
result.append("\""); | ||
} | ||
} | ||
result.append(", "); | ||
} | ||
result.delete(result.lastIndexOf(", "), result.length() - 1); | ||
result.append("]"); | ||
return result.toString(); | ||
} | ||
|
||
} |
Oops, something went wrong.