Skip to content

Commit

Permalink
Merge pull request #350 from starwit/develop
Browse files Browse the repository at this point in the history
Test build
  • Loading branch information
witchpou authored Aug 11, 2023
2 parents 881ad02 + 5df5e90 commit 593a071
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,69 +41,68 @@ public static Set<String> gatherEntityImports(Domain domain) {
}

private static void addGeneralImports(Set<String> imports) {
imports.add("import javax.persistence.Column;");
imports.add("import javax.persistence.Entity;");
imports.add("import javax.persistence.Table;");
imports.add("import javax.xml.bind.annotation.XmlRootElement;");
imports.add("import jakarta.persistence.Column;");
imports.add("import jakarta.persistence.Entity;");
imports.add("import jakarta.persistence.Table;");
}

private static void addImportsForAttribute(Set<String> imports, Attribute attr) {
if (DataType.String.equals(attr.getDataType())) {
if (attr.getMax() != null || attr.getMin() != null) {
imports.add("import javax.validation.constraints.Size;");
imports.add("import jakarta.validation.constraints.Size;");
}
if (!attr.isNullable()) {
imports.add("import javax.validation.constraints.NotBlank;");
imports.add("import jakarta.validation.constraints.NotBlank;");
}
} else if (DataType.Date.equals(attr.getDataType()) || DataType.Time.equals(attr.getDataType())
|| DataType.Timestamp.equals(attr.getDataType())) {
imports.add("import java.util.Date;");
imports.add("import javax.persistence.Temporal;");
imports.add("import javax.persistence.TemporalType;");
imports.add("import jakarta.persistence.Temporal;");
imports.add("import jakarta.persistence.TemporalType;");
} else if (DataType.Enum.equals(attr.getDataType())) {
imports.add("import javax.persistence.EnumType;");
imports.add("import javax.persistence.Enumerated;");
imports.add("import jakarta.persistence.EnumType;");
imports.add("import jakarta.persistence.Enumerated;");
} else if (DataType.BigDecimal.equals(attr.getDataType())) {
imports.add("import java.math.BigDecimal;");
}
if (attr.getPattern() != null) {
imports.add("import javax.validation.constraints.Pattern;");
imports.add("import jakarta.validation.constraints.Pattern;");
}

if (!DataType.String.equals(attr.getDataType())) {
if (!attr.isNullable()) {
imports.add("import javax.validation.constraints.NotNull;");
imports.add("import jakarta.validation.constraints.NotNull;");
}
if (attr.getMax() != null) {
imports.add("import javax.validation.constraints.Max;");
imports.add("import jakarta.validation.constraints.Max;");
}
if (attr.getMin() != null) {
imports.add("import javax.validation.constraints.Min;");
imports.add("import jakarta.validation.constraints.Min;");
}
}
}

private static void addImportsForRelations(Set<String> imports, Relationship relation) {
imports.add("import javax.persistence." + relation.getRelationshipType() + ";");
imports.add("import jakarta.persistence." + relation.getRelationshipType() + ";");
imports.add("import com.fasterxml.jackson.annotation.JsonFilter;");
// imports.add("import javax.persistence.FetchType;");
// imports.add("import jakarta.persistence.FetchType;");

if (RelationshipType.ManyToMany.equals(relation.getRelationshipType()) ||
RelationshipType.ManyToOne.equals(relation.getRelationshipType()) ||
RelationshipType.OneToOne.equals(relation.getRelationshipType())) {
imports.add("import javax.persistence.JoinColumn;");
imports.add("import jakarta.persistence.JoinColumn;");
}
if (RelationshipType.ManyToMany.equals(relation.getRelationshipType()) &&
relation.isOwnerSide()) {
imports.add("import javax.persistence.JoinTable;");
imports.add("import jakarta.persistence.JoinTable;");
}
if (RelationshipType.OneToMany.equals(relation.getRelationshipType())
|| RelationshipType.ManyToMany.equals(relation.getRelationshipType())) {
imports.add("import java.util.Set;");
}
if (RelationshipType.OneToOne.equals(relation.getRelationshipType()) &&
relation.isOwnerSide()) {
imports.add("import javax.persistence.CascadeType;");
imports.add("import jakarta.persistence.CascadeType;");
}
}
}
4 changes: 3 additions & 1 deletion webclient/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
"@mui/lab": "^5.0.0-alpha.63",
"@mui/material": "^5.0.0",
"@mui/styles": "^5.0.0",
"@mui/x-date-pickers": "^6.10.2",
"@sentry/react": "^7.1.1",
"@sentry/tracing": "^7.1.1",
"@starwit/react-starwit": "1.0.3",
"@starwit/react-starwit": "1.0.6",
"axios": "^0.24.0",
"i18next": "^21.0.1",
"i18next-browser-languagedetector": "^6.1.2",
"immer": "^9.0.12",
"moment": "^2.29.4",
"notistack": "^2.0.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down

0 comments on commit 593a071

Please sign in to comment.