-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed view getIsConstantsplit out generators
- Loading branch information
synapticloop
committed
Jun 10, 2020
1 parent
b2f5356
commit fe76d73
Showing
41 changed files
with
2,073 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
|
||
./gradlew assemble pTML -b build.gradle | ||
./gradlew -b build.h2zero.mysql.gradle h2zero | ||
./gradlew --stacktrace -b build.h2zero.mysql.gradle h2zero | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package synapticloop.h2zero.model; | ||
|
||
/* | ||
* Copyright (c) 2020 synapticloop. | ||
* | ||
* All rights reserved. | ||
* | ||
* This source code and any derived binaries are covered by the terms and | ||
* conditions of the Licence agreement ("the Licence"). You may not use this | ||
* source code or any derived binaries except in compliance with the Licence. | ||
* A copy of the Licence is available in the file named LICENCE shipped with | ||
* this source code or binaries. | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the Licence is distributed on an "AS IS" BASIS, WITHOUT | ||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
* Licence for the specific language governing permissions and limitations | ||
* under the Licence. | ||
*/ | ||
|
||
import org.json.JSONObject; | ||
|
||
import synapticloop.h2zero.exception.H2ZeroParseException; | ||
import synapticloop.h2zero.model.util.JSONKeyConstants; | ||
import synapticloop.h2zero.util.JsonHelper; | ||
|
||
public class Upserter extends BaseQueryObject { | ||
|
||
/** | ||
* Create an umodel object | ||
* | ||
* @param baseSchemaObject The base schema object to attach to | ||
* @param upserterObject The JSON object that encapsulates the upserter | ||
* | ||
* @throws H2ZeroParseException If there was an error parsing the JSON upserter | ||
* object | ||
*/ | ||
public Upserter(BaseSchemaObject baseSchemaObject, JSONObject upserterObject) throws H2ZeroParseException { | ||
super(baseSchemaObject, upserterObject); | ||
|
||
} | ||
|
||
@Override | ||
public String getType() { return("Upserter"); } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
PACKAGE DECLARATION, IMPORT STATEMENTS AND CLASS DEFINITION | ||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --} | ||
|
||
package {database.package}.upserter;{\n}{\n} | ||
// - - - - thoughtfully generated by synapticloop h2zero - - - - {\n} | ||
// with the use of synapticloop templar templating language{\n} | ||
// (java-create-upserter.templar){\n}{\n} | ||
|
||
{import classpath:/snippet/global/finder-imports.templar} | ||
|
||
|
||
public class {table.javaClassName}Upserter {{{\n} | ||
|
||
{set table as baseSchemaObject} | ||
|
||
{import classpath:/snippet/global/java-binder-declaration.templar} | ||
|
||
{set "Upserter" as classType} | ||
{set table.javaClassName as loggerClass} | ||
|
||
{import classpath:/snippet/global/java-logger-declaration.templar} | ||
|
||
|
||
{set table as tableOrView} | ||
|
||
{-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
STATIC SQL STATEMENTS | ||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --} | ||
|
||
{import classpath:/snippet/finder/sql-statements.templar} | ||
|
||
{-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
STATEMENT CACHES | ||
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --} | ||
|
||
{\n}{\t}private {table.javaClassName}Upserter() {{}{\n}{\n} | ||
{loop table.upserters as upserter} | ||
{set upserter as finder} | ||
{\t}public static boolean {upserter.name}({import classpath:/snippet/finder/method-parameters.templar}) {{{\n} | ||
{\t}{\t}return(false);{\n} | ||
{\t}}{\n} | ||
{\n} | ||
{endloop} | ||
} |
43 changes: 43 additions & 0 deletions
43
src/test/java/synapticloop/sample/h2zero/cockroach/upserter/AllTypesUpserter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package synapticloop.sample.h2zero.cockroach.upserter; | ||
|
||
// - - - - thoughtfully generated by synapticloop h2zero - - - - | ||
// with the use of synapticloop templar templating language | ||
// (java-create-upserter.templar) | ||
|
||
import java.sql.Connection; | ||
import java.sql.PreparedStatement; | ||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
import java.math.BigDecimal; | ||
import java.util.List; | ||
import java.util.ArrayList; | ||
|
||
import synapticloop.h2zero.base.exception.H2ZeroFinderException; | ||
import synapticloop.h2zero.base.manager.cockroach.ConnectionManager; | ||
import synapticloop.h2zero.util.LruCache; | ||
|
||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
|
||
import synapticloop.sample.h2zero.cockroach.model.util.Constants; | ||
|
||
import synapticloop.sample.h2zero.cockroach.model.AllTypes; | ||
|
||
public class AllTypesUpserter { | ||
// the binder is unused in code, but will generate compile problems if this | ||
// class is no longer referenced in the h2zero file. Just a nicety for | ||
// removing dead code | ||
@SuppressWarnings("unused") | ||
private static final String BINDER = Constants.ALL_TYPES_BINDER; | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(AllTypesUpserter.class); | ||
private static final String SQL_SELECT_START = "select id_all_types, num_smallint, num_integer, num_bigint, num_decimal, num_numeric, flt_real, dbl_real, num_serial, num_smallserial, num_bigserial from all_types"; | ||
private static final String SQL_BUILTIN_FIND_BY_PRIMARY_KEY = SQL_SELECT_START + " where id_all_types = ?"; | ||
|
||
|
||
|
||
private AllTypesUpserter() {} | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
src/test/java/synapticloop/sample/h2zero/cockroach/upserter/PetUpserter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package synapticloop.sample.h2zero.cockroach.upserter; | ||
|
||
// - - - - thoughtfully generated by synapticloop h2zero - - - - | ||
// with the use of synapticloop templar templating language | ||
// (java-create-upserter.templar) | ||
|
||
import java.sql.Connection; | ||
import java.sql.PreparedStatement; | ||
import java.sql.ResultSet; | ||
import java.sql.SQLException; | ||
import java.sql.Date; | ||
import java.sql.Blob; | ||
import java.math.BigDecimal; | ||
import java.util.List; | ||
import java.util.ArrayList; | ||
|
||
import synapticloop.h2zero.base.exception.H2ZeroFinderException; | ||
import synapticloop.h2zero.base.manager.cockroach.ConnectionManager; | ||
import synapticloop.h2zero.util.LruCache; | ||
|
||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
|
||
import synapticloop.sample.h2zero.cockroach.model.util.Constants; | ||
|
||
import synapticloop.sample.h2zero.cockroach.model.Pet; | ||
|
||
public class PetUpserter { | ||
// the binder is unused in code, but will generate compile problems if this | ||
// class is no longer referenced in the h2zero file. Just a nicety for | ||
// removing dead code | ||
@SuppressWarnings("unused") | ||
private static final String BINDER = Constants.PET_BINDER; | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(PetUpserter.class); | ||
private static final String SQL_SELECT_START = "select id_pet, nm_pet, num_age, flt_weight, dt_birthday, img_photo from pet"; | ||
private static final String SQL_BUILTIN_FIND_BY_PRIMARY_KEY = SQL_SELECT_START + " where id_pet = ?"; | ||
|
||
private static final String SQL_FIND_BY_NM_PET_NUM_AGE = SQL_SELECT_START + " where nm_pet = ? and num_age = ?"; | ||
|
||
|
||
private PetUpserter() {} | ||
|
||
} |
Oops, something went wrong.