Skip to content

Commit 47e51e1

Browse files
committed
fix: missing relationship, use primitives in java
1 parent 7a74cc6 commit 47e51e1

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

templates/cli/lib/type-generation/languages/dart.js.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Dart extends LanguageMeta {
2323
break;
2424
case AttributeType.RELATIONSHIP:
2525
type = LanguageMeta.toPascalCase(attribute.relatedCollection);
26-
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || attribute.relationType === 'manyToMany') {
26+
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') (attribute.relationType === 'manyToOne' && attribute.side === 'child') || || attribute.relationType === 'manyToMany') {
2727
type = `List<${type}>`;
2828
}
2929
break;

templates/cli/lib/type-generation/languages/java.js.twig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@ class Java extends LanguageMeta {
1313
type = "String";
1414
break;
1515
case AttributeType.INTEGER:
16-
type = "Integer";
16+
type = "int";
1717
break;
1818
case AttributeType.FLOAT:
19-
type = "Double";
19+
type = "double";
2020
break;
2121
case AttributeType.BOOLEAN:
22-
type = "Boolean";
22+
type = "boolean";
2323
break;
2424
case AttributeType.RELATIONSHIP:
2525
type = LanguageMeta.toPascalCase(attribute.relatedCollection);
26-
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || attribute.relationType === 'manyToMany') {
26+
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || (attribute.relationType === 'manyToOne' && attribute.side === 'child') || attribute.relationType === 'manyToMany') {
2727
type = "List<" + type + ">";
2828
}
2929
break;

templates/cli/lib/type-generation/languages/javascript.js.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class JavaScript extends LanguageMeta {
2828
break;
2929
case AttributeType.RELATIONSHIP:
3030
type = LanguageMeta.toPascalCase(attribute.relatedCollection);
31-
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || attribute.relationType === 'manyToMany') {
31+
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || (attribute.relationType === 'manyToOne' && attribute.side === 'child') || attribute.relationType === 'manyToMany') {
3232
type = `Array<${type}>`;
3333
}
3434
break;

templates/cli/lib/type-generation/languages/kotlin.js.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Kotlin extends LanguageMeta {
2323
break;
2424
case AttributeType.RELATIONSHIP:
2525
type = LanguageMeta.toPascalCase(attribute.relatedCollection);
26-
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || attribute.relationType === 'manyToMany') {
26+
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || (attribute.relationType === 'manyToOne' && attribute.side === 'child') || attribute.relationType === 'manyToMany') {
2727
type = `List<${type}>`;
2828
}
2929
break;

templates/cli/lib/type-generation/languages/php.js.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class PHP extends LanguageMeta {
2626
break;
2727
case AttributeType.RELATIONSHIP:
2828
type = LanguageMeta.toPascalCase(attribute.relatedCollection);
29-
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || attribute.relationType === 'manyToMany') {
29+
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || (attribute.relationType === 'manyToOne' && attribute.side === 'child') || attribute.relationType === 'manyToMany') {
3030
type = "array";
3131
}
3232
break;

templates/cli/lib/type-generation/languages/swift.js.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class Swift extends LanguageMeta {
2323
break;
2424
case AttributeType.RELATIONSHIP:
2525
type = LanguageMeta.toPascalCase(attribute.relatedCollection);
26-
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || attribute.relationType === 'manyToMany') {
26+
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || (attribute.relationType === 'manyToOne' && attribute.side === 'child') || attribute.relationType === 'manyToMany') {
2727
type = `[${type}]`;
2828
}
2929
break;

templates/cli/lib/type-generation/languages/typescript.js.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class TypeScript extends LanguageMeta {
2828
break;
2929
case AttributeType.RELATIONSHIP:
3030
type = LanguageMeta.toPascalCase(attribute.relatedCollection);
31-
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || attribute.relationType === 'manyToMany') {
31+
if ((attribute.relationType === 'oneToMany' && attribute.side === 'parent') || (attribute.relationType === 'manyToOne' && attribute.side === 'child') || attribute.relationType === 'manyToMany') {
3232
type = `${type}[]`;
3333
}
3434
break;

0 commit comments

Comments
 (0)