/*
 * Copyright (c) 2016 Martin Norbert
 *  Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.site_monitor.model.db;

import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.stmt.PreparedDelete;

import org.site_monitor.model.bo.SiteCall;

import java.sql.SQLException;
import java.util.Date;

/**
 * Created by Martin Norbert on 31/01/2016.
 */
public class DBSiteCall {

    private Dao<SiteCall, Long> dao;

    public DBSiteCall(Dao<SiteCall, Long> dao) {
        this.dao = dao;
    }

    public int create(SiteCall siteCall) throws SQLException {
        return dao.create(siteCall);
    }

    public void removeCallsBefore(Date date) throws SQLException {
        dao.delete((PreparedDelete<SiteCall>) dao.deleteBuilder().where().lt("date", date).prepare());
    }
}

@@ -1123,12 +1123,11 @@
 lic 
-void
+int
  rem
@@ -1182,16 +1182,23 @@
         
+return 
 dao.dele

fix purge problem : 1 month (missing class)