From b06535eb2ebbaa8ade757fc59f5293be2dccf645 Mon Sep 17 00:00:00 2001 From: Struchkov Mark Date: Fri, 1 Apr 2022 13:17:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=B3=D0=B5=D0=BD=D0=B5=D1=80=D0=B0=D1=86=D0=B8=D1=8E?= =?UTF-8?q?=20=D0=BF=D0=BE=D0=BB=D1=8F=20=D0=B0=D0=B9=D0=B4=D0=B8=20=D0=B1?= =?UTF-8?q?=D0=B0=D0=B7=D0=BE=D0=B2=D0=BE=D0=B9=20=D1=81=D1=83=D1=89=D0=BD?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D0=B8=20=D0=B4=D0=BB=D1=8F=20ElementCollecti?= =?UTF-8?q?on?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utils/fieldconstants/processor/FieldNameProcessor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/dev/struchkov/haiti/utils/fieldconstants/processor/FieldNameProcessor.java b/src/main/java/dev/struchkov/haiti/utils/fieldconstants/processor/FieldNameProcessor.java index e5fda18..5790748 100644 --- a/src/main/java/dev/struchkov/haiti/utils/fieldconstants/processor/FieldNameProcessor.java +++ b/src/main/java/dev/struchkov/haiti/utils/fieldconstants/processor/FieldNameProcessor.java @@ -68,7 +68,7 @@ public class FieldNameProcessor extends AbstractProcessor { final List simpleFields = getSimpleFields(allFields, anTable, tableSettings); final List joinFields = getJoinFields(allFields); - final List elementCollectionFields = getElementCollectionsFields(allFields); + final List elementCollectionFields = getElementCollectionsFields(anTable.name(), allFields); final ClassTableDto newClass = new ClassTableDto(); newClass.setClassName(newClassName); @@ -80,7 +80,7 @@ public class FieldNameProcessor extends AbstractProcessor { CreatorClassTableMode.record(newClass, processingEnv); } - private List getElementCollectionsFields(List allFields) { + private List getElementCollectionsFields(String tableName, List allFields) { return allFields.stream() .filter( field -> field.getAnnotation(ElementCollectionField.class) != null && @@ -93,7 +93,7 @@ public class FieldNameProcessor extends AbstractProcessor { final CollectionTable collectionTable = field.getAnnotation(CollectionTable.class); final Column column = field.getAnnotation(Column.class); - final JoinTableContainer firstContainer = JoinTableContainer.of(collectionTable.name(), elementCollectionField.parentId(), collectionTable.joinColumns()[0].name()); + final JoinTableContainer firstContainer = JoinTableContainer.of(collectionTable.name(), tableName + "." + elementCollectionField.parentId(), collectionTable.joinColumns()[0].name()); final JoinTableContainer secondContainer = JoinTableContainer.of(elementCollectionField.childTable(), column.name(), elementCollectionField.childReference()); return JoinElemCollectionDto.of(fieldName, firstContainer, secondContainer); }).collect(Collectors.toList());