Skip to content

Commit 2d58d4a

Browse files
author
synapticloop
committed
fixed imports for counters
1 parent acf1475 commit 2d58d4a

File tree

4 files changed

+40
-15
lines changed

4 files changed

+40
-15
lines changed

build.gradle

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ plugins {
1212
id 'co.riiid.gradle' version '0.4.2'
1313

1414
id 'synapticloop.copyrightr' version '1.3.1'
15-
id 'synapticloop.documentr' version '3.0.0'
15+
id 'synapticloop.documentr' version '3.1.0'
1616

1717
id "org.sonarqube" version "2.7"
1818

@@ -21,7 +21,7 @@ plugins {
2121
group = 'synapticloop'
2222
archivesBaseName = 'h2zero'
2323
description = """lightweight ORM generator for mysql/sqlite, java with extensions for taglibs and routemaster"""
24-
version = '4.2.0'
24+
version = '4.2.1'
2525

2626
tasks.withType(Javadoc).all { enabled = false }
2727

@@ -114,19 +114,6 @@ shadowJar {
114114
configurations = [project.configurations.shadowRuntime]
115115
}
116116

117-
dependencyUpdates.resolutionStrategy = {
118-
componentSelection { rules ->
119-
rules.all { ComponentSelection selection ->
120-
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'b', 'dmr'].any { qualifier ->
121-
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
122-
}
123-
if (rejected) {
124-
selection.reject('Release candidate')
125-
}
126-
}
127-
}
128-
}
129-
130117
def javaApiUrl = 'http://docs.oracle.com/javase/1.7.0/docs/api/'
131118
def groovyApiUrl = 'http://groovy.codehaus.org/gapi/'
132119

@@ -243,3 +230,15 @@ copyrightr {
243230

244231
failOnMissing = false
245232
}
233+
234+
documentr {
235+
// where to generate the README file
236+
directory = '.'
237+
238+
// wnether to be verbose and output more
239+
verbose = 'true'
240+
241+
// extension - can be either md or adoc
242+
extension = 'md' // this is the default
243+
// extension = 'adoc' // perhaps you want asciidoc?
244+
}

src/main/java/synapticloop/h2zero/H2ZeroParser.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
import synapticloop.h2zero.validator.updater.UpdaterQueryParameterNameValidator;
9797
import synapticloop.h2zero.validator.updater.UpdaterSetClauseValidator;
9898
import synapticloop.h2zero.validator.updater.UpdaterWhereClauseValidator;
99+
import synapticloop.h2zero.validator.view.ViewAsClauseValidator;
99100

100101
/**
101102
* This is the parser for the h2zero generator
@@ -129,6 +130,8 @@ public class H2ZeroParser {
129130
validators.add(new TablePrimaryKeyTypeValidator());
130131
validators.add(new TableIgnoredKeysValidator());
131132

133+
// view validators
134+
validators.add(new ViewAsClauseValidator());
132135

133136
// field validators
134137
validators.add(new FieldDefaultValueValidator());
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package synapticloop.h2zero.validator.view;
2+
3+
import java.util.List;
4+
5+
import synapticloop.h2zero.model.Database;
6+
import synapticloop.h2zero.model.Options;
7+
import synapticloop.h2zero.model.View;
8+
import synapticloop.h2zero.validator.BaseValidator;
9+
10+
public class ViewAsClauseValidator extends BaseValidator{
11+
12+
@Override
13+
public void validate(Database database, Options options) {
14+
List<View> views = database.getViews();
15+
for (View view : views) {
16+
if(view.getAsClause().endsWith(";")) {
17+
addWarnMessage("The 'asClause' for " + view.getName() + " has a trailing ';' character, which will cause a warning when generating the SQL statement.");
18+
}
19+
}
20+
}
21+
22+
}

src/main/resources/java-create-counter.templar

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import java.sql.SQLException;{\n}
1414
import java.util.HashMap;{\n}
1515
import java.util.Map;{\n}
1616
import java.util.List;{\n}
17+
import java.sql.*;{\n}
1718
{\n}
1819
import synapticloop.h2zero.base.manager.{options.database}.ConnectionManager;{\n}
1920
{\n}

0 commit comments

Comments
 (0)