Untitled

 avatar
unknown
plain_text
6 months ago
2.0 kB
3
Indexable
  // Map the event data to the ApplicationGenParam entity
            ApplicationGenParam applicationGenParam = new ApplicationGenParam();
            applicationGenParam.setParamKey((String) eventData.get("paramKey"));
            applicationGenParam.setSubParamKey((String) eventData.get("subParamKey"));
            applicationGenParam.setParamValue((String) eventData.get("paramValue"));
            applicationGenParam.setParamDesc((String) eventData.get("description"));
            applicationGenParam.setParamType((String) eventData.get("paramType"));
            applicationGenParam.setSubParamType((String) eventData.get("subParamType"));
            applicationGenParam.setPattern((String) eventData.get("paramPattern"));
            applicationGenParam.setDataType((String) eventData.get("paramDataType"));

            // Set default or fixed values for other entity fields
            applicationGenParam.setCreatedBy((String) event.get("triggeredBy"));
            applicationGenParam.setCreatedDt(LocalDateTime.now());
            applicationGenParam.setModifiedBy((String) event.get("triggeredBy"));
            applicationGenParam.setModifiedDt(LocalDateTime.now());
            applicationGenParam.setAction((String) event.get("action"));
            applicationGenParam.setStatus("A"); // Assuming 'A' means active
            applicationGenParam.setCacheRequired("N"); // Default value, can be changed

            // Convert event timestamp from long to LocalDateTime
            long eventTimestamp = (long) event.get("eventTimeStamp");
            LocalDateTime eventTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(eventTimestamp), ZoneId.systemDefault());
            applicationGenParam.setMigDat(eventTime);

            // Save the entity to the database
            applicationGenParamRepository.save(applicationGenParam);

            // Acknowledge the message after successful processing
            message.ack();
Editor is loading...
Leave a Comment