# 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
        return res

    @classmethod
    def delete_by_id(cls, id):
        try:
            elem = cls.get(id)
            adapter.delete(elem)
            adapter.commit()
        except:
            adapter.rollback()
            raise

    @classmethod
    def delete_by_condition(cls, **kwargs):
        target_list = cls.find(**kwargs)
        try:
            for target in target_list:
                adapter.session.delete(target)
            adapter.commit()
        except:
            adapter.rollback()
            raise

    @classmethod
    def find(cls, order=None, commit=True, **kwargs):
        res = adapter.session.query(cls).order_by(order).filter_by(**kwargs).all()
        if commit:
            adapter.session.commit()
        return res


# 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

        return res

    @classmethod
    def delete_by_id(cls, id):
        try:
            elem = cls.get(id)
            adapter.delete(elem)
            adapter.commit()
        except:
            adapter.rollback()
            raise

    @classmethod
    def delete_by_condition(cls, **kwargs):
        target_list = cls.find(**kwargs)
        try:
            for target in target_list:
                adapter.session.delete(target)
            adapter.commit()
        except:
            adapter.rollback()
            raise

    @classmethod
    def find(cls, order=None, commit=True, **kwargs):
        res = adapter.session.query(cls).order_by(order).filter_by(**kwargs).all()
        if commit:
            adapter.session.commit()
        return res


class KMRDBAdapter(BaseAdapter):