-
Notifications
You must be signed in to change notification settings - Fork 38
Generating Models
This project makes creating Object Relational Mapping (ORM) models extremely simple via a BASH script. This script is named ZIMGenModels.sh (and is located in the "gen" folder). Essentially, the BASH script will fetch from an existing SQLite database a list of table names and their respective column information and will generate models for each table.
The first step is to configure the property values in ZIMGenModels.properties. There are three properties to configure: the application, the author, and the database. To do so, just change the value to the right of the equals sign. Here is an example:
application=MyApplication
author=Ziminji
database=livedb.sqlite
The next step is to make sure that you have permission to run the BASH script. From the command line in your Terminal window, navigate to the directory where you saved the files. Once in the correct directory, type the following command and press "return":
username$ chmod +x ZIMGenModels.sh
The final step is to run the actual BASH script with the Java properties file.
username$ ./ZIMGenModels.sh ZIMGenModels.properties
When the BASH script finishes, the newly created models will be in the same folder you just ran the script from.