Say for instance i have the following class:
class SuperModel
{
private OracleProvider database;
private SqlTemplates template;
public SuperModel()
{
this.database = new OracleProvider();
this.template = new SqlTemplates(database);
}
protected SqlTemplates getTemplate()
{
return this.template;
}
}
Now i have the following class extending the above:
class Henvendelser : SuperModel
{
public Henvendelser()
{
}
public ArrayList getQueue(DateTime start, DateTime end)
{
String sql =
"SELECT " +
" TIDSPUNKT, " +
" NVL(QUEUE,' ') AS QUEUE, " +
" NVL(SUM(ANTAL_KALD),0) AS CALLS, " +
" NVL(SUM(ANTAL_BESVARET),0) AS ANSWERED_CALLS, " +
" NVL(SUM(BESVARET_25_SEK),0) AS ANSWERED_CALLS_25_SEC, " +
" NVL(SUM(INTERN_KALD),0) AS INTERNAL_CALLS " +
"FROM " +
" KS_DRIFT.PERO_NKM_KØ_OVERSIGT " +
"WHERE " +
" TIDSPUNKT >= '" + start+ "' AND " +
" TIDSPUNKT <= '" + end + "' AND " +
" TO_CHAR(TIDSPUNKT,'DY') NOT IN ('AB') " +
"GROUP BY " +
" QUEUE " +
"ORDER BY " +
" TIDSPUNKT ";
ArrayList result = this.getTemplate().template(sql, SqlTemplates.READ_FROM_QUERY);
return result;
}
}
is the SuperModel
's constructor called automaticly or do i have to do something in order to make sure it is called?