8월, 2023의 게시물 표시

[MariaDB] list inside list. row has multiple data

이미지
 SELECT t1.id ,JSON_ARRAYAGG(       JSON_OBJECT(         't2_id', t2.id,         't2_title', t2.title       )     ) AS t2_json FROM t_test1 t1 LEFT JOIN t_test2 t2 ON t2.test1_id=t1.id  GROUP BY t1.id ; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; public class JsonToMapListExample {     public static void main(String[] args) throws Exception {         String jsonData = "[{\"t2_id\": 1, \"t2_title\": \"t21\"},{\"t2_id\": 2, \"t2_title\": \"t22\"}]";         ObjectMapper objectMapper = new ObjectMapper();         List<Map<String, Object>> dataList = objectMapper.readValue(jsonData, new TypeReference<List<Map<String, Object>>>() {});         // Now you can work with the List<Map<String, Object>> data         for (Map<String, Object> map : dataList) {             System.out.println("t2_id:

[Unreal] c++, blueprint 서로 연동

이미지
 // Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "UObject/Interface.h" #include "HitInterface.generated.h" // This class does not need to be modified. UINTERFACE(MinimalAPI) class UHitInterface : public UInterface { GENERATED_BODY() }; /**  *   */ class SLASH_API IHitInterface { GENERATED_BODY() // Add interface functions to this class. This is the class that will be inherited to implement this interface. public: UFUNCTION(BlueprintNativeEvent) void GetHit(const FVector& ImpactPoint); }; - call full c++ code in blueprint (can be called c++ to c++, c++ then blueprint then c++) - after declaring BlueprintNativeEvent, inherited overrides and implement function body must have '_Implementation' attached. void ABreakableActor:: GetHit_Implementation (const FVector& ImpactPoint) { } HitInterface-> Execute_GetHit (BoxHit.GetActor(), BoxHit.ImpactPoint); (firs