41 # define __attribute__(x)
53 namespace persistence {
76 _impl->setPolicy(policy);
83 _impl->setPersistLocation(location);
90 _impl->setRetrieveLocation(location);
96 _impl->startTransaction();
102 _impl->endTransaction();
113 std::string
const& templateName,
114 bool mayAlreadyExist) {
115 _impl->createTableFromTemplate(tableName, templateName, mayAlreadyExist);
122 _impl->dropTable(tableName);
129 _impl->truncateTable(tableName);
137 _impl->executeSql(sqlStatement);
144 _impl->setTableForInsert(tableName);
151 template <
typename T>
153 _impl->setColumn(columnName, value);
160 _impl->setColumnToNull(columnName);
176 _impl->setTableForQuery(tableName, isExpr);
183 std::vector<std::string>
const& tableNameList) {
184 _impl->setTableListForQuery(tableNameList);
195 _impl->outColumn(columnName, isExpr);
206 template <
typename T>
209 _impl->outParam(columnName, location, isExpr);
217 template <
typename T>
219 _impl->condParam(paramName, value);
227 _impl->orderBy(expression);
234 _impl->groupBy(expression);
243 _impl->setQueryWhere(whereClause);
256 return _impl->next();
262 template <
typename T>
264 return _impl->getColumnByPos<T>(pos);
271 return _impl->columnIsNull(pos);
279 _impl->finishQuery();
285 template void DbStorage::setColumn<>(std::string
const& columnName,
char const& value);
286 template void DbStorage::setColumn<>(std::string
const& columnName,
short const& value);
287 template void DbStorage::setColumn<>(std::string
const& columnName,
int const& value);
288 template void DbStorage::setColumn<>(std::string
const& columnName,
long const& value);
289 template void DbStorage::setColumn<>(std::string
const& columnName,
long long const& value);
290 template void DbStorage::setColumn<>(std::string
const& columnName,
float const& value);
291 template void DbStorage::setColumn<>(std::string
const& columnName,
double const& value);
292 template void DbStorage::setColumn<>(std::string
const& columnName, std::string
const& value);
293 template void DbStorage::setColumn<>(std::string
const& columnName,
bool const& value);
294 template void DbStorage::setColumn<>(std::string
const& columnName,
DateTime const& value);
296 template void DbStorage::outParam<>(std::string
const& columnName,
char* location,
bool isExpr);
297 template void DbStorage::outParam<>(std::string
const& columnName,
short* location,
bool isExpr);
298 template void DbStorage::outParam<>(std::string
const& columnName,
int* location,
bool isExpr);
299 template void DbStorage::outParam<>(std::string
const& columnName,
long* location,
bool isExpr);
300 template void DbStorage::outParam<>(std::string
const& columnName,
long long* location,
bool isExpr);
301 template void DbStorage::outParam<>(std::string
const& columnName,
float* location,
bool isExpr);
302 template void DbStorage::outParam<>(std::string
const& columnName,
double* location,
bool isExpr);
303 template void DbStorage::outParam<>(std::string
const& columnName, std::string* location,
bool isExpr);
304 template void DbStorage::outParam<>(std::string
const& columnName,
bool* location,
bool isExpr);
305 template void DbStorage::outParam<>(std::string
const& columnName,
DateTime* location,
bool isExpr);
307 template void DbStorage::condParam<>(std::string
const& paramName,
char const& value);
308 template void DbStorage::condParam<>(std::string
const& paramName,
short const& value);
309 template void DbStorage::condParam<>(std::string
const& paramName,
int const& value);
310 template void DbStorage::condParam<>(std::string
const& paramName,
long const& value);
311 template void DbStorage::condParam<>(std::string
const& paramName,
long long const& value);
312 template void DbStorage::condParam<>(std::string
const& paramName,
float const& value);
313 template void DbStorage::condParam<>(std::string
const& paramName,
double const& value);
314 template void DbStorage::condParam<>(std::string
const& paramName, std::string
const& value);
315 template void DbStorage::condParam<>(std::string
const& paramName,
bool const& value);
316 template void DbStorage::condParam<>(std::string
const& paramName,
DateTime const& value);
318 template char const& DbStorage::getColumnByPos<>(
int pos);
319 template short const& DbStorage::getColumnByPos<>(
int pos);
320 template int const& DbStorage::getColumnByPos<>(
int pos);
321 template long const& DbStorage::getColumnByPos<>(
int pos);
322 template long long const& DbStorage::getColumnByPos<>(
int pos);
323 template float const& DbStorage::getColumnByPos<>(
int pos);
324 template double const& DbStorage::getColumnByPos<>(
int pos);
325 template std::string
const& DbStorage::getColumnByPos<>(
int pos);
326 template bool const& DbStorage::getColumnByPos<>(
int pos);
327 template DateTime const& DbStorage::getColumnByPos<>(
int pos);
void outParam(std::string const &columnName, T *location, bool isExpr=false)
virtual void executeSql(std::string const &sqlStatement)
Class for handling dates/times, including MJD, UTC, and TAI.
virtual void outColumn(std::string const &columnName, bool isExpr=false)
Interface for DbStorage class.
void setColumn(std::string const &columnName, T const &value)
boost::scoped_ptr< DbStorageImpl > _impl
Implementation class for isolation.
Class for logical location of a persisted Persistable instance.
virtual void setQueryWhere(std::string const &whereClause)
boost::shared_ptr< Policy > Ptr
T const & getColumnByPos(int pos)
virtual void dropTable(std::string const &tableName)
bool columnIsNull(int pos)
void condParam(std::string const ¶mName, T const &value)
virtual void startTransaction(void)
virtual void groupBy(std::string const &expression)
virtual void setPolicy(lsst::pex::policy::Policy::Ptr policy)
virtual void orderBy(std::string const &expression)
virtual void setRetrieveLocation(LogicalLocation const &location)
virtual void endTransaction(void)
virtual void insertRow(void)
Interface for DateTime class.
Class for implementation of database storage.
virtual void setTableForQuery(std::string const &tableName, bool isExpr=false)
virtual void setTableListForQuery(std::vector< std::string > const &tableNameList)
Interface for DbStorageImpl class.
virtual void finishQuery(void)
virtual void setTableForInsert(std::string const &tableName)
virtual void setPersistLocation(LogicalLocation const &location)
virtual void createTableFromTemplate(std::string const &tableName, std::string const &templateName, bool mayAlreadyExist=false)
virtual void setColumnToNull(std::string const &columnName)
Abstract base class for storage implementations.
virtual void truncateTable(std::string const &tableName)