DB to create tables in (note if blank and db.driver=org.sqlite.JDBC creates a SQLite DB in genSpring.outdir folder. See Db.getUrl(ResourceBundle bundle, String folder))
db.url=jdbc:sqlite:L:/sites/git/genSpring/target/watchlistDB.sqlite
db.driver=org.sqlite.JDBC
db.user=
db.password=
db.name=
className.key note list values are the field names but are compared case insensitive to avoid mismatches
Account.JsonIgnore=password
Account.unique=email
Account.list=id,email,role,created
Sheet1.testCols=5
Sheet2.testCols=5
Sheet1.testRows=8
Sheet2.testRows=8
Sheet1User.testCols=5
Sheet1User.testRows=8
Creates a DB from a Google sheet with a table for each selected tab
Basically set your options in /genSpring/src/main/resources/genSpring.properties
** Note after a clean you will be asked to auth to Google to access the sheet. See target/tokens folder**
genSpring.outdir=../genSpringTest
genSpring.id=1-xYv1AVkUC5J3Tqpy2_3alZ5ZpBPnnO2vUGUCUeLVVE
genSpring.tabs=Networks,shows,Roamio_npl,Roamio_sp,Roamio_Todo,OTA,CableCard
genSpring.userTabs=Roamio_npl,Roamio_sp,Roamio_Todo,OTA,CableCard
Sheet1.columns=A-C,F Sheet2.columns=A,C-E
tableName.required (not null) columns. Rows with null in these columns will not be imported. Note ignored if not in exported columns
Sheet1.required=A Sheet2.required=A,C-D
Sheet1.lastRow=251
Sheet1.user=E
Create a simple Spring boot CRUD app with both web and REST interfaces from a DB complete with basic hard coded, in mem, auth system. Tested with SQLite but code was brought over from Struts version for MySQL and SQLServer that will probably work. Note for safety reasons it will not overwrite existing files so just delete the files you want to regen and run the tools again.
Basically set your options in /genSpring/src/main/resources/genSpring.properties
genSpring.outdir=../genSpringTest
genSpring.Copyright=Copyright (c) 2001-
genSpring.Company=RMRR
genSpring.version=
genSpring.pkg=com.dea42
genSpring.module=genSpring
genSpring.artifactId=genSpringTest
genSpring.beanToString=true
add a equals() and hashCode() to the entity bean and form classes ( now always true so mock testing can work)
genSpring.beanEquals=true
genSpring.useDouble=true
genSpring.filteredTables=providers
genSpring.tomcatPort=8089
Then run /genSpring/src/main/java/com/dea42/build/GenSpring.java as a console Java app.
USAGE: Genspring [options] [table names]
Where options are:
-double = use Double instead of BigDecimal for entities beans (also genSpring.useDouble in properties file)
-toString = generate toString() methods for entities beans (Always true now)
-beanEquals = generate equals() methods for entities beans (Always true now)
if table names not given then runs on all tables in DB.
Note: be sure to set properties in resources/genSpring.properties before running.
For example with a DB containing the tables Sheet1 and Sheet2 would generate these files
#Basic structure is
./pom.xml
./src/main/java/{pkg.module}/db/SQLiteDialect.java (Only if using SQLite)
Language files. Note currently just these 3 UTF-8 ones and only common text is translated. To translate your table and field names use https://www.google.com/search?q=translate+java+properties+file with untranslated properties from ./src/main/resources/messages.properties
./src/main/resources/messages.properties
./src/main/resources/messages_de.properties
./src/main/resources/messages_fr.properties
./src/main/resources/templates/api_index.html
./src/main/resources/templates/edit_*.html
./src/main/resources/templates/*s.html
./src/main/webapp/public/optView.html ** sample static web page**
./src/main/webapp/public/Players.html ** sample static web page**
./src/main/webapp/public/resources/sheet.css ** css file for Google sheet tabs exported as HTML**
./src/main/resources/templates/*.html
./src/main/webapp/favicon.ico ** sample site icon**
./src/main/webapp/resources/css/bootstrap.min.css
./src/main/webapp/resources/css/site.css
./src/main/webapp/resources/js/bootstrap.min.js
./src/main/webapp/resources/js/jquery.min.js
./src/main/webapp/resources/fonts/*
./src/main/webapp/WEB-INF/web.xml
./src/test/java/{pkg.module}/WebAppApplicationTest.java
./src/test/java/{pkg.module}/controller/*ControllerTest.java
./src/test/java/{pkg.module}/search/*SearchTest.java
./src/test/java/{pkg.module}/UnitBase.java
./src/test/java/{pkg.module}/MockBase.java
./src/test/java/{pkg.module}/selenium/SeleniumBase.java
./src/test/java/{pkg.module}/selenium/SmokeIT.java
./src/test/java/{pkg.module}/selenium/SmokeTest.java
./src/test/resources/rename.properties
./src/test/resources/test.properties
Use the integration maven profile to run test of a cargo deployed version of the app
- Import generated project as existing maven project
- Do maven install ** Note this runs a basic tests of the build as well**
- Run ../genSpringTest/src/main/java/com/dea42/genSpring/WebAppApplication.java as Java or Spring Boot app
- Wait for start up
- Point browser to http://localhost:8080/