@@ -0,0 +1,1461 @@
+package com.twistlet.entity;%0A%0Aimport java.io.File;%0Aimport java.io.IOException;%0Aimport java.util.Collection;%0Aimport java.util.List;%0A%0Aimport javax.persistence.Column;%0A%0Aimport org.apache.commons.io.FileUtils;%0A%0Apublic class ActionAddSpringDataAuditing %7B%0A%09public static void main(String%5B%5D args) throws IOException %7B%0A%09%09String directory = args%5B0%5D;%0A%09%09Collection%3CFile%3E files = FileUtils.listFiles(new File(directory), null, false);%0A%09%09for (File file : files) %7B%0A%09%09%09List%3CString%3E lines = FileUtils.readLines(file, %22UTF-8%22);%0A%09%09%09transformLines(lines, %22@JoinColumn(name=%5C%22created_by%5C%22)%22, %22@org.springframework.data.annotation.CreatedBy%22);%0A%09%09%09transformLines(lines, %22@JoinColumn(name=%5C%22last_modified_by%5C%22)%22,%0A%09%09%09%09%09%22@org.springframework.data.annotation.LastModifiedBy%22);%0A%09%09%09transformLines(lines, %22@Column(name=%5C%22created_date%5C%22%22,%0A%09%09%09%09%09%22@org.springframework.data.annotation.CreatedDate%22);%0A%09%09%09transformLines(lines, %22@Column(name=%5C%22last_modified_date%5C%22%22,%0A%09%09%09%09%09%22@org.springframework.data.annotation.LastModifiedDate%22);%0A%09%09%09FileUtils.writeLines(file, lines);%0A%09%09%7D%0A%09%7D%0A%0A%09public static void transformLines(List%3CString%3E lines, String keyword, String toBeAddedBelow) %7B%0A%09%09int index = findIndex(lines, keyword);%0A%09%09if (index %3E 0) %7B%0A%09%09%09lines.add(index + 1, %22    %22 + toBeAddedBelow);%0A%09%09%7D%0A%09%7D%0A%0A%09private static int findIndex(List%3CString%3E lines, String keyword) %7B%0A%09%09int n = lines.size();%0A%09%09for (int i = 0; i %3C n; i++) %7B%0A%09%09%09if (lines.get(i).contains(keyword)) %7B%0A%09%09%09%09return i;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return -1;%0A%09%7D%0A%0A%7D%0A

add auditing annotation to jpa entities