avatar42 / genSpring

Create a simple Spring boot app from a DB
Apache License 2.0
0 stars 0 forks source link

Add better validation of imported data #42

Open avatar42 opened 3 years ago

avatar42 commented 3 years ago

For instance a - in a date field will go into a SQLite DB but then generate an exception when Hibernate tries to read it from the DB later.

avatar42 commented 3 years ago

In 0.6.1 doing a complete rewrite of this. First adding tabName.colum,type to override detection and force a column to be a Java type as for "Watchlist" sheet: Roamio_Todo.G.type=java.lang.String shows.Y.type=java.util.Date

Also setting blank cells and cells with errors to null values with if (StringUtils.isBlank(s)) cells[i] = null; else if (s.startsWith("#VALUE!")) cells[i] = null; else if (s.startsWith("#NUM!")) cells[i] = null; else if (s.startsWith("#REF!")) cells[i] = null; else if (s.startsWith("#N/A")) cells[i] = null; else if (s.equals("#N/A")) cells[i] = null;

avatar42 commented 3 years ago

as of 0.6.2 is a column has no data for any record the generated test for that column will fail with no records found. Either exclude the column or comment out the test.

avatar42 commented 3 years ago

Add better handling of dates in 0.6.2