Skip to content

Commit

Permalink
added in generated source files for simple project
Browse files Browse the repository at this point in the history
  • Loading branch information
synapticloop committed Aug 17, 2015
1 parent a23231c commit 726c0cc
Show file tree
Hide file tree
Showing 113 changed files with 35,331 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
build-eclipse/
build/
CVS
generate/*

cobertura.ser
.DS_Store
src/test/java/insityou.h2zero
Expand Down
Binary file modified dist/h2zero.jar
Binary file not shown.
Binary file modified dist/h2zero.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package synapticloop.sample.h2zero.bean;

// - - - - thoughtfully generated by synapticloop h2zero - - - -
// with the use of synapticloop templar templating language
// (java-create-select-clause-bean.templar)

import java.sql.Date;
import java.sql.Timestamp;



public class FindGroupNumAgeBean {
private Integer numCount = null;
private Integer numAge = null;

public FindGroupNumAgeBean(Integer numCount, Integer numAge) {
this.numCount = numCount;
this.numAge = numAge;
}

public Integer getNumCount() { return(this.numCount); }
public void setNumCount(Integer numCount) { this.numCount = numCount; }
public Integer getNumAge() { return(this.numAge); }
public void setNumAge(Integer numAge) { this.numAge = numAge; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package synapticloop.sample.h2zero.bean;

// - - - - thoughtfully generated by synapticloop h2zero - - - -
// with the use of synapticloop templar templating language
// (java-create-select-clause-bean.templar)

import java.sql.Date;
import java.sql.Timestamp;



public class FindNmUserDtmSignupBean {
private String nmUser = null;
private Timestamp dtmSignup = null;

public FindNmUserDtmSignupBean(String nmUser, Timestamp dtmSignup) {
this.nmUser = nmUser;
this.dtmSignup = dtmSignup;
}

public String getNmUser() { return(this.nmUser); }
public void setNmUser(String nmUser) { this.nmUser = nmUser; }
public Timestamp getDtmSignup() { return(this.dtmSignup); }
public void setDtmSignup(Timestamp dtmSignup) { this.dtmSignup = dtmSignup; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
package synapticloop.sample.h2zero.counter;

// - - - - thoughtfully generated by synapticloop h2zero - - - -
// with the use of synapticloop templar templating language
// (java-create-counter.templar)

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import java.util.List;

import synapticloop.h2zero.base.manager.ConnectionManager;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;

import synapticloop.sample.h2zero.model.util.Constants;

public class PetCounter {
// 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 = Logger.getLogger(PetCounter.class);

private static final String SQL_BUILTIN_COUNT_ALL = "select count(*) from pet";



private PetCounter() {}

/**
* Find the count of all Pet objects
*
* @param connection the passed in connection object, useful for queries within
* a transaction.
*
* @return the count of Pet objects
*
* @throws SQLException if there was an error in the SQL statement
*/
public static int countAll(Connection connection) throws SQLException {
PreparedStatement preparedStatement = null;
ResultSet resultSet = null;
int count = -1;

try {
preparedStatement = connection.prepareStatement(SQL_BUILTIN_COUNT_ALL);
resultSet = preparedStatement.executeQuery();
if(resultSet.next()) {
count = resultSet.getInt(1);
}
} catch(SQLException sqlex) {
if(LOGGER.isEnabledFor(Level.WARN)) {
LOGGER.warn("SQLException countAll(connection): " + sqlex.getMessage());
if(LOGGER.isEnabledFor(Level.DEBUG)) {
sqlex.printStackTrace();
}
}
throw sqlex;
} finally {
ConnectionManager.closeAll(resultSet, preparedStatement);
}

return(count);
}

/**
* Find the count of all Pet objects
*
* @return the count of Pet objects
*
* @throws SQLException if there was an error in the SQL statement
*/
public static int countAll() throws SQLException {
Connection connection = null;

try {
connection = ConnectionManager.getConnection();
return(countAll(connection));
} catch(SQLException sqlex) {
if(LOGGER.isEnabledFor(Level.WARN)) {
LOGGER.warn("SQLException countAll(): " + sqlex.getMessage());
if(LOGGER.isEnabledFor(Level.DEBUG)) {
sqlex.printStackTrace();
}
}
throw sqlex;
} finally {
ConnectionManager.closeAll(connection);
}
}

/**
* Find the count of all Pet objects and if there is an error
* fail silently and log the error.
*
* @param connection the passed in connection object, useful for queries within
* a transaction.
*
* @return the count of Pet objects
*
*/
public static int countAllSilent(Connection connection) {
try {
return(countAll(connection));
} catch(SQLException sqlex){
if(LOGGER.isEnabledFor(Level.WARN)) {
LOGGER.warn("SQLException countAllSilent(connection): " + sqlex.getMessage());
if(LOGGER.isEnabledFor(Level.DEBUG)) {
sqlex.printStackTrace();
}
}
return(-1);
}
}

/**
* Find the count of all Pet objects and if there is an error
* fail silently and log the error.
*
* @return the count of Pet objects
*
*/
public static int countAllSilent() {
try {
return(countAll());
} catch(SQLException sqlex){
if(LOGGER.isEnabledFor(Level.WARN)) {
LOGGER.warn("SQLException countAllSilent(): " + sqlex.getMessage());
if(LOGGER.isEnabledFor(Level.DEBUG)) {
sqlex.printStackTrace();
}
}
return(-1);
}
}

}
Loading

0 comments on commit 726c0cc

Please sign in to comment.