# Path: kokemomo/plugins/engine/model/km_storage/km_adapter.py
# class BaseAdapter(object):
#     __metaclass__ = ABCMeta
# 
#     #@abstractproperty
#     #def Model(self):
#     #    pass
# 
#     @abstractmethod
#     def init(self, *args, **kwargs):
#         pass
# 
#     #@abstractmethod
#     #def set(self, *args, **kwargs):
#     #    pass
# 
#     #@abstractmethod
#     #def get(self, *args, **kwargs):
#     #    pass
# 
# Path: kokemomo/settings/common.py
# DATA_BASE = 'sqlite:///data.db'
# 
# DATA_BASE_OPTIONS = {}


from sqlalchemy import Column, Integer, String, DateTime, Boolean, Text, func
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
from kokemomo.plugins.engine.model.km_storage.km_adapter import BaseAdapter
from kokemomo.settings.common import DATA_BASE, DATA_BASE_OPTIONS
        self.session.rollback()

    def get(self, *args, **kwargs):
        pass

def rollback():
    adapter.session.rollback()

class Transaction(object):
    @classmethod
    def begin(cls):
        return adapter.session.begin(subtransactions=True)

    @classmethod
    def add(cls, *args, **kwargs):
        adapter.session.add(*args, **kwargs)

    @classmethod
    def delete(cls, *args, **kwargs):
        adapter.session.delete(*args, **kwargs)

    @classmethod
    def commit(cls):
        adapter.session.commit()

    @classmethod
    def rollback(self):
        adapter.session.rollback()



# Path: kokemomo/plugins/engine/model/km_storage/km_adapter.py
# class BaseAdapter(object):
#     __metaclass__ = ABCMeta
# 
#     #@abstractproperty
#     #def Model(self):
#     #    pass
# 
#     @abstractmethod
#     def init(self, *args, **kwargs):
#         pass
# 
#     #@abstractmethod
#     #def set(self, *args, **kwargs):
#     #    pass
# 
#     #@abstractmethod
#     #def get(self, *args, **kwargs):
#     #    pass
# 
# Path: kokemomo/settings/common.py
# DATA_BASE = 'sqlite:///data.db'
# 
# DATA_BASE_OPTIONS = {}


# Path: kokemomo/plugins/engine/model/km_storage/impl/km_rdb_adapter.py
from sqlalchemy import Column, Integer, String, DateTime, Boolean, Text, func
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import scoped_session, sessionmaker
from kokemomo.plugins.engine.model.km_storage.km_adapter import BaseAdapter
from kokemomo.settings.common import DATA_BASE, DATA_BASE_OPTIONS

        self.session.rollback()

    def get(self, *args, **kwargs):
        pass

def rollback():
    adapter.session.rollback()

class Transaction(object):
    @classmethod
    def begin(cls):
        return adapter.session.begin(subtransactions=True)

    @classmethod
    def add(cls, *args, **kwargs):
        adapter.session.add(*args, **kwargs)

    @classmethod
    def delete(cls, *args, **kwargs):
        adapter.session.delete(*args, **kwargs)

    @classmethod
    def commit(cls):
        adapter.session.commit()

    @classmethod
    def rollback(self):
        adapter.session.rollback()



adapter = KMRDBAdapter(DATA_BASE, DATA_BASE_OPTIONS)