Skip to content

Commit 536ade9

Browse files
author
synapticloop
committed
changed to postgresql package
1 parent ccf3086 commit 536ade9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+10037
-1
lines changed

build.h2zero.postgresql.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ repositories {
2828
}
2929

3030
h2zero {
31-
inFile = 'src/test/resources/sample-include-postgresql.h2zero'
31+
inFile = 'src/test/resources/postgresql/sample-include-postgresql.h2zero'
3232
outDir = '.'
3333
verbose = 'false'
3434
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package synapticloop.sample.h2zero.postgresql.bean;
2+
3+
// - - - - thoughtfully generated by synapticloop h2zero - - - -
4+
// with the use of synapticloop templar templating language
5+
// (java-create-select-clause-bean.templar)
6+
7+
import java.sql.Date;
8+
import java.sql.Timestamp;
9+
10+
public class FindGroupNumAgeBean {
11+
private Integer numCount = null;
12+
private Integer numAge = null;
13+
14+
public FindGroupNumAgeBean(Integer numCount, Integer numAge) {
15+
this.numCount = numCount;
16+
this.numAge = numAge;
17+
}
18+
19+
public Integer getNumCount() { return(this.numCount); }
20+
public void setNumCount(Integer numCount) { this.numCount = numCount; }
21+
public Integer getNumAge() { return(this.numAge); }
22+
public void setNumAge(Integer numAge) { this.numAge = numAge; }
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package synapticloop.sample.h2zero.postgresql.bean;
2+
3+
// - - - - thoughtfully generated by synapticloop h2zero - - - -
4+
// with the use of synapticloop templar templating language
5+
// (java-create-select-clause-bean.templar)
6+
7+
import java.sql.Date;
8+
import java.sql.Timestamp;
9+
10+
public class FindIdUserTitleNmUserTitleOrderedBean {
11+
private Long idUserTitle = null;
12+
private String nmUserTitle = null;
13+
14+
public FindIdUserTitleNmUserTitleOrderedBean(Long idUserTitle, String nmUserTitle) {
15+
this.idUserTitle = idUserTitle;
16+
this.nmUserTitle = nmUserTitle;
17+
}
18+
19+
public Long getIdUserTitle() { return(this.idUserTitle); }
20+
public void setIdUserTitle(Long idUserTitle) { this.idUserTitle = idUserTitle; }
21+
public String getNmUserTitle() { return(this.nmUserTitle); }
22+
public void setNmUserTitle(String nmUserTitle) { this.nmUserTitle = nmUserTitle; }
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package synapticloop.sample.h2zero.postgresql.bean;
2+
3+
// - - - - thoughtfully generated by synapticloop h2zero - - - -
4+
// with the use of synapticloop templar templating language
5+
// (java-create-select-clause-bean.templar)
6+
7+
import java.sql.Date;
8+
import java.sql.Timestamp;
9+
10+
public class FindNmUserDtmSignupBean {
11+
private String nmUser = null;
12+
private Timestamp dtmSignup = null;
13+
14+
public FindNmUserDtmSignupBean(String nmUser, Timestamp dtmSignup) {
15+
this.nmUser = nmUser;
16+
this.dtmSignup = dtmSignup;
17+
}
18+
19+
public String getNmUser() { return(this.nmUser); }
20+
public void setNmUser(String nmUser) { this.nmUser = nmUser; }
21+
public Timestamp getDtmSignup() { return(this.dtmSignup); }
22+
public void setDtmSignup(Timestamp dtmSignup) { this.dtmSignup = dtmSignup; }
23+
}
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
package synapticloop.sample.h2zero.postgresql.counter;
2+
3+
// - - - - thoughtfully generated by synapticloop h2zero - - - -
4+
// with the use of synapticloop templar templating language
5+
// (java-create-counter.templar)
6+
7+
import java.sql.Connection;
8+
import java.sql.PreparedStatement;
9+
import java.sql.ResultSet;
10+
import java.sql.SQLException;
11+
import java.util.HashMap;
12+
import java.util.Map;
13+
import java.util.List;
14+
import java.sql.*;
15+
16+
import synapticloop.h2zero.base.manager.cockroach.ConnectionManager;
17+
18+
19+
import org.slf4j.Logger;
20+
import org.slf4j.LoggerFactory;
21+
22+
23+
import synapticloop.sample.h2zero.postgresql.model.util.Constants;
24+
25+
public class AllTypesCounter {
26+
// the binder is unused in code, but will generate compile problems if this
27+
// class is no longer referenced in the h2zero file. Just a nicety for
28+
// removing dead code
29+
@SuppressWarnings("unused")
30+
private static final String BINDER = Constants.ALL_TYPES_BINDER;
31+
32+
private static final Logger LOGGER = LoggerFactory.getLogger(AllTypesCounter.class);
33+
34+
35+
private static final String SQL_BUILTIN_COUNT_ALL = "select count(*) from all_types";
36+
37+
38+
39+
private AllTypesCounter() {}
40+
41+
/**
42+
* Find the count of all AllTypes objects
43+
*
44+
* @param connection the passed in connection object, useful for queries within
45+
* a transaction.
46+
*
47+
* @return the count of AllTypes objects
48+
*
49+
* @throws SQLException if there was an error in the SQL statement
50+
*/
51+
public static int countAll(Connection connection) throws SQLException {
52+
PreparedStatement preparedStatement = null;
53+
ResultSet resultSet = null;
54+
int count = -1;
55+
56+
try {
57+
preparedStatement = connection.prepareStatement(SQL_BUILTIN_COUNT_ALL);
58+
resultSet = preparedStatement.executeQuery();
59+
if(resultSet.next()) {
60+
count = resultSet.getInt(1);
61+
}
62+
} catch(SQLException sqlex) {
63+
if(LOGGER.isWarnEnabled()) {
64+
LOGGER.warn("SQLException countAll(connection): " + sqlex.getMessage());
65+
if(LOGGER.isDebugEnabled()) {
66+
sqlex.printStackTrace();
67+
}
68+
}
69+
throw sqlex;
70+
} finally {
71+
ConnectionManager.closeAll(resultSet, preparedStatement);
72+
}
73+
74+
return(count);
75+
}
76+
77+
/**
78+
* Find the count of all AllTypes objects
79+
*
80+
* @return the count of AllTypes objects
81+
*
82+
* @throws SQLException if there was an error in the SQL statement
83+
*/
84+
public static int countAll() throws SQLException {
85+
Connection connection = null;
86+
87+
try {
88+
connection = ConnectionManager.getConnection();
89+
return(countAll(connection));
90+
} catch(SQLException sqlex) {
91+
if(LOGGER.isWarnEnabled()) {
92+
LOGGER.warn("SQLException countAll(): " + sqlex.getMessage());
93+
if(LOGGER.isDebugEnabled()) {
94+
sqlex.printStackTrace();
95+
}
96+
}
97+
throw sqlex;
98+
} finally {
99+
ConnectionManager.closeAll(connection);
100+
}
101+
}
102+
103+
/**
104+
* Find the count of all AllTypes objects and if there is an error
105+
* fail silently and log the error.
106+
*
107+
* @param connection the passed in connection object, useful for queries within
108+
* a transaction.
109+
*
110+
* @return the count of AllTypes objects
111+
*
112+
*/
113+
public static int countAllSilent(Connection connection) {
114+
try {
115+
return(countAll(connection));
116+
} catch(SQLException sqlex){
117+
if(LOGGER.isWarnEnabled()) {
118+
LOGGER.warn("SQLException countAllSilent(connection): " + sqlex.getMessage());
119+
if(LOGGER.isDebugEnabled()) {
120+
sqlex.printStackTrace();
121+
}
122+
}
123+
return(-1);
124+
}
125+
}
126+
127+
/**
128+
* Find the count of all AllTypes objects and if there is an error
129+
* fail silently and log the error.
130+
*
131+
* @return the count of AllTypes objects
132+
*
133+
*/
134+
public static int countAllSilent() {
135+
try {
136+
return(countAll());
137+
} catch(SQLException sqlex){
138+
if(LOGGER.isWarnEnabled()) {
139+
LOGGER.warn("SQLException countAllSilent(): " + sqlex.getMessage());
140+
if(LOGGER.isDebugEnabled()) {
141+
sqlex.printStackTrace();
142+
}
143+
}
144+
return(-1);
145+
}
146+
}
147+
148+
}
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
package synapticloop.sample.h2zero.postgresql.counter;
2+
3+
// - - - - thoughtfully generated by synapticloop h2zero - - - -
4+
// with the use of synapticloop templar templating language
5+
// (java-create-counter.templar)
6+
7+
import java.sql.Connection;
8+
import java.sql.PreparedStatement;
9+
import java.sql.ResultSet;
10+
import java.sql.SQLException;
11+
import java.util.HashMap;
12+
import java.util.Map;
13+
import java.util.List;
14+
import java.sql.*;
15+
16+
import synapticloop.h2zero.base.manager.cockroach.ConnectionManager;
17+
18+
19+
import org.slf4j.Logger;
20+
import org.slf4j.LoggerFactory;
21+
22+
23+
import synapticloop.sample.h2zero.postgresql.model.util.Constants;
24+
25+
public class PetCounter {
26+
// the binder is unused in code, but will generate compile problems if this
27+
// class is no longer referenced in the h2zero file. Just a nicety for
28+
// removing dead code
29+
@SuppressWarnings("unused")
30+
private static final String BINDER = Constants.PET_BINDER;
31+
32+
private static final Logger LOGGER = LoggerFactory.getLogger(PetCounter.class);
33+
34+
35+
private static final String SQL_BUILTIN_COUNT_ALL = "select count(*) from pet";
36+
37+
38+
39+
private PetCounter() {}
40+
41+
/**
42+
* Find the count of all Pet objects
43+
*
44+
* @param connection the passed in connection object, useful for queries within
45+
* a transaction.
46+
*
47+
* @return the count of Pet objects
48+
*
49+
* @throws SQLException if there was an error in the SQL statement
50+
*/
51+
public static int countAll(Connection connection) throws SQLException {
52+
PreparedStatement preparedStatement = null;
53+
ResultSet resultSet = null;
54+
int count = -1;
55+
56+
try {
57+
preparedStatement = connection.prepareStatement(SQL_BUILTIN_COUNT_ALL);
58+
resultSet = preparedStatement.executeQuery();
59+
if(resultSet.next()) {
60+
count = resultSet.getInt(1);
61+
}
62+
} catch(SQLException sqlex) {
63+
if(LOGGER.isWarnEnabled()) {
64+
LOGGER.warn("SQLException countAll(connection): " + sqlex.getMessage());
65+
if(LOGGER.isDebugEnabled()) {
66+
sqlex.printStackTrace();
67+
}
68+
}
69+
throw sqlex;
70+
} finally {
71+
ConnectionManager.closeAll(resultSet, preparedStatement);
72+
}
73+
74+
return(count);
75+
}
76+
77+
/**
78+
* Find the count of all Pet objects
79+
*
80+
* @return the count of Pet objects
81+
*
82+
* @throws SQLException if there was an error in the SQL statement
83+
*/
84+
public static int countAll() throws SQLException {
85+
Connection connection = null;
86+
87+
try {
88+
connection = ConnectionManager.getConnection();
89+
return(countAll(connection));
90+
} catch(SQLException sqlex) {
91+
if(LOGGER.isWarnEnabled()) {
92+
LOGGER.warn("SQLException countAll(): " + sqlex.getMessage());
93+
if(LOGGER.isDebugEnabled()) {
94+
sqlex.printStackTrace();
95+
}
96+
}
97+
throw sqlex;
98+
} finally {
99+
ConnectionManager.closeAll(connection);
100+
}
101+
}
102+
103+
/**
104+
* Find the count of all Pet objects and if there is an error
105+
* fail silently and log the error.
106+
*
107+
* @param connection the passed in connection object, useful for queries within
108+
* a transaction.
109+
*
110+
* @return the count of Pet objects
111+
*
112+
*/
113+
public static int countAllSilent(Connection connection) {
114+
try {
115+
return(countAll(connection));
116+
} catch(SQLException sqlex){
117+
if(LOGGER.isWarnEnabled()) {
118+
LOGGER.warn("SQLException countAllSilent(connection): " + sqlex.getMessage());
119+
if(LOGGER.isDebugEnabled()) {
120+
sqlex.printStackTrace();
121+
}
122+
}
123+
return(-1);
124+
}
125+
}
126+
127+
/**
128+
* Find the count of all Pet objects and if there is an error
129+
* fail silently and log the error.
130+
*
131+
* @return the count of Pet objects
132+
*
133+
*/
134+
public static int countAllSilent() {
135+
try {
136+
return(countAll());
137+
} catch(SQLException sqlex){
138+
if(LOGGER.isWarnEnabled()) {
139+
LOGGER.warn("SQLException countAllSilent(): " + sqlex.getMessage());
140+
if(LOGGER.isDebugEnabled()) {
141+
sqlex.printStackTrace();
142+
}
143+
}
144+
return(-1);
145+
}
146+
}
147+
148+
}

0 commit comments

Comments
 (0)