@@ -145,54 +145,55 @@ private static boolean isDirectAttachmentTargetAspect(String targetAspect) {
145145 return targetAspect != null && targetAspect .equalsIgnoreCase ("sap.attachments.Attachments" );
146146 }
147147
148- public static List <String > getAttachmentEntityPathsWithActualPropertyNames (
149- CdsModel model , CdsEntity entity , PersistenceService persistenceService ) {
150- try {
151- List <String > actualPaths = new ArrayList <>();
152-
153- // Get all compositions from the target entity
154- entity
155- .compositions ()
156- .forEach (
157- composition -> {
158- String compositionName = composition .getName ();
159- String compositionTargetEntityName = "" ;
160- if (composition .getType ().isAssociation ()) {
161- CdsAssociationType assocType = (CdsAssociationType ) composition .getType ();
162- compositionTargetEntityName = assocType .getTarget ().getQualifiedName ();
163- }
164-
165- // Check if the target entity of this composition has attachments
166- if (!compositionTargetEntityName .isEmpty ()) {
167- Optional <CdsEntity > targetEntityOpt =
168- model .findEntity (compositionTargetEntityName );
169- if (targetEntityOpt .isPresent ()) {
170- CdsEntity targetEntity = targetEntityOpt .get ();
171-
172- // Get attachment paths from the target entity
173- SDMAssociationCascader cascader = new SDMAssociationCascader ();
174- SDMAttachmentsReader reader =
175- new SDMAttachmentsReader (cascader , persistenceService );
176- List <String > attachmentPaths =
177- reader .getAttachmentEntityPaths (model , targetEntity );
178-
179- // Transform the paths to use the actual composition property name
180- for (String attachmentPath : attachmentPaths ) {
181- String actualPath = buildActualPath (entity , compositionName , attachmentPath );
182- if (actualPath != null ) {
183- actualPaths .add (actualPath );
184- }
185- }
186- }
187- }
188- });
189-
190- return actualPaths ;
191- } catch (Exception e ) {
192- logger .error ("Error getting attachment entity paths with actual property names" , e );
193- return new ArrayList <>();
194- }
195- }
148+ // public static List<String> getAttachmentEntityPathsWithActualPropertyNames(
149+ // CdsModel model, CdsEntity entity, PersistenceService persistenceService) {
150+ // try {
151+ // List<String> actualPaths = new ArrayList<>();
152+
153+ // // Get all compositions from the target entity
154+ // entity
155+ // .compositions()
156+ // .forEach(
157+ // composition -> {
158+ // String compositionName = composition.getName();
159+ // String compositionTargetEntityName = "";
160+ // if (composition.getType().isAssociation()) {
161+ // CdsAssociationType assocType = (CdsAssociationType) composition.getType();
162+ // compositionTargetEntityName = assocType.getTarget().getQualifiedName();
163+ // }
164+
165+ // // Check if the target entity of this composition has attachments
166+ // if (!compositionTargetEntityName.isEmpty()) {
167+ // Optional<CdsEntity> targetEntityOpt =
168+ // model.findEntity(compositionTargetEntityName);
169+ // if (targetEntityOpt.isPresent()) {
170+ // CdsEntity targetEntity = targetEntityOpt.get();
171+
172+ // // Get attachment paths from the target entity
173+ // SDMAssociationCascader cascader = new SDMAssociationCascader();
174+ // SDMAttachmentsReader reader =
175+ // new SDMAttachmentsReader(cascader, persistenceService);
176+ // List<String> attachmentPaths =
177+ // reader.getAttachmentEntityPaths(model, targetEntity);
178+
179+ // // Transform the paths to use the actual composition property name
180+ // for (String attachmentPath : attachmentPaths) {
181+ // String actualPath = buildActualPath(entity, compositionName,
182+ // attachmentPath);
183+ // if (actualPath != null) {
184+ // actualPaths.add(actualPath);
185+ // }
186+ // }
187+ // }
188+ // }
189+ // });
190+
191+ // return actualPaths;
192+ // } catch (Exception e) {
193+ // logger.error("Error getting attachment entity paths with actual property names", e);
194+ // return new ArrayList<>();
195+ // }
196+ // }
196197
197198 public static List <Map <String , Object >> fetchAttachments (
198199 String targetEntity , Map <String , Object > entity , String attachmentCompositionName ) {
0 commit comments