SQLDatabaseDao

MongoDbDao methods:

SQLDatabaseAdapter getSqlDatabaseAdapter(); //gets SQLDatabaseAdapter 
Object getId() //gets correct value of Id field
DbModel getModel() //gets model

How to create DAO?

public class SQLDatabaseMyUserDao extends SQLDatabaseDao {

    public SQLDatabaseMyUserDao(Model model) {
        super(model);
    }

    @Override
    public Object update(Model model) {
        //define your update logic
        return model;
    }
    
    @Override
    public Object save(Model model) {
        //define your save logic
        return model;
    }

    @Override
    public boolean delete(Model model) {
        //define your delete logic

        return true;
    }

Last updated