forked from m0ver/tinystruct-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplicationGenerator.java
More file actions
executable file
·31 lines (26 loc) · 934 Bytes
/
ApplicationGenerator.java
File metadata and controls
executable file
·31 lines (26 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import org.tinystruct.ApplicationException;
import org.tinystruct.data.tools.Generator;
import org.tinystruct.data.tools.MySQLGenerator;
public class ApplicationGenerator {
public static void main(String[]arguments)
{
System.out.println("Please type the command like this:ApplicationGenerator className tableName");
try {
String[] list=new String[]{"book"};
// String[] list=new String[]{"Member","User","Rights","Role"};
for(String className:list)
{
Generator generator=new MySQLGenerator();
generator.setFileName("src/custom/objects/");
generator.setPackageName("custom.objects");
generator.importPackages("java.util.Date");
generator.create(className,className);
System.out.println("class:"+className+" table:"+className);
}
} catch (ApplicationException e) {
e.printStackTrace();
}
System.out.println("OK!");
System.out.close();
}
}