1 #ifndef INCLUDE_ORA_DATABASE_H
2 #define INCLUDE_ORA_DATABASE_H
15 #include <boost/shared_ptr.hpp>
45 Database(boost::shared_ptr<ConnectionPool>& connectionPool);
120 template <
typename T> boost::shared_ptr<T>
fetch(
const OId& oid);
129 template <
typename T>
OId insert(
const T& data);
135 template <
typename T>
void update(
const OId& oid,
const T& data );
178 void open(
bool writingAccess=
false );
206 template <
typename T>
212 template <
typename T>
215 return createContainer(
typeid(
T) );
218 template <
typename T>
225 template <
typename T>
229 Container cont = getContainer( containerName,
typeid(data) );
230 int itemId = cont.
insert( data );
231 return OId( cont.
id(), itemId );
234 template <
typename T>
238 int itemId = cont.
insert( data );
239 return OId( cont.
id(), itemId );
242 template <
typename T>
250 template <
typename T>
253 return boost::static_pointer_cast<
T>( getTypedObjectByName( name,
typeid(
T) ) );
bool create(std::string userSchemaVersion=std::string(""))
int insert(const T &data)
Object fetchItemByName(const std::string &name)
OId insert(const std::string &containerName, const T &data)
tuple cont
load Luminosity info ##
const std::string & connectionString()
bool getItemId(const std::string &name, OId &destination)
ora::Version schemaVersion(bool userSchema=false)
void open(bool writingAccess=false)
bool lockContainer(const std::string &name)
Transaction & transaction()
SharedSession & storageAccessSession()
void erase(const OId &oid)
Object fetchItem(const OId &oid)
Container containerHandle(const std::string &name)
boost::shared_ptr< T > fetchByName(const std::string &name)
std::set< std::string > containers()
void update(int itemId, const T &data)
boost::shared_ptr< T > fetch(const OId &oid)
bool dropContainer(const std::string &name)
Container createContainer()
boost::shared_ptr< DatabaseImpl > m_impl
DatabaseUtility utility()
bool getNamesForObject(const OId &oid, std::vector< std::string > &destination)
OId insertItem(const std::string &containerName, const Object &data)
Database & operator=(const Database &rhs)
bool connect(const std::string &connectionString, bool readOnly=false)
bool eraseObjectName(const std::string &name)
char data[epos_bytes_allocation]
static std::string nameForContainer(const std::type_info &typeInfo)
void update(const OId &oid, const T &data)
boost::shared_ptr< T > fetch(int itemId)
bool listObjectNames(std::vector< std::string > &destination)
boost::shared_ptr< void > getTypedObjectByName(const std::string &name, const std::type_info &typeInfo)
Configuration & configuration()
void updateItem(const OId &oid, const Object &data)
void setObjectName(const std::string &name, const OId &oid)
std::string className(const T &t)
Container getContainer(const std::string &name, const std::type_info &typeInfo)
void setAccessPermission(const std::string &principal, bool forWrite)