#* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. *# package $basePackageName; import java.sql.Connection; import java.util.List; import java.util.ArrayList; import org.apache.empire.db.DBCommand; import org.apache.empire.db.DBDatabase; import org.apache.empire.db.DBReader; import org.apache.empire.db.DBRecord; #if($nestTables == true || $nestViews == true) import org.apache.empire.data.DataType; #end #if($nestTables == true) import org.apache.empire.db.DBTableColumn; #end import $tablePackageName.*; import $viewPackageName.*; public class $dbClassName extends DBDatabase { private static $dbClassName instance; private static final long serialVersionUID = 1L; #foreach($table in $database.tables) #set($tblClass=$parser.getTableClassName($table.name)) public final $tblClass ${table.name} = new $tblClass(this); #end #foreach($view in $database.views) #set($viewClass=$parser.getViewClassName($view.name)) public final $viewClass ${view.name} = new $viewClass(this); #end /** * Returns the instance of the database. * @return */ public static $dbClassName get() { if (instance == null) { instance = new ${dbClassName}(); } return instance; } /** * Default constructor for the $dbClassName. */ private ${dbClassName}() { } #if($nestTables == true) #foreach ($table in $database.tables) #parse( "$templateFolder/Table.vm" ) #end #end #if($nestViews == true) #foreach ($view in $database.views) #parse( "$templateFolder/View.vm" ) #end #end }