예제 #1
0
 protected AbstractADODiffStorage(AbstractADODataModel dataModel,
                                  String getDiffSQL,
                                  String getDiffsSQL,
                                  String getAverageItemPrefSQL,
                                  String[] updateDiffSQLs,
                                  String[] removeDiffSQLs,
                                  String getRecommendableItemsSQL,
                                  String deleteDiffsSQL,
                                  String createDiffsSQL,
                                  String diffsExistSQL,
                                  int minDiffCount)
 {
     if (dataModel == null)
     {
         throw new ArgumentNullException("dataModel is null");
     }
     if (minDiffCount < 0)
     {
         throw new ArgumentException("minDiffCount is not positive");
     }
     this.dataModel                = dataModel;
     this.getDiffSQL               = getDiffSQL;
     this.getDiffsSQL              = getDiffsSQL;
     this.getAverageItemPrefSQL    = getAverageItemPrefSQL;
     this.updateDiffSQLs           = updateDiffSQLs;
     this.removeDiffSQLs           = removeDiffSQLs;
     this.getRecommendableItemsSQL = getRecommendableItemsSQL;
     this.deleteDiffsSQL           = deleteDiffsSQL;
     this.createDiffsSQL           = createDiffsSQL;
     this.diffsExistSQL            = diffsExistSQL;
     this.minDiffCount             = minDiffCount;
     this.refreshLock              = new ReentrantLock();
     if (IsDiffsExist())
     {
         log.Info("Diffs already exist in database; using them instead of recomputing");
     }
     else
     {
         log.Info("No diffs exist in database; recomputing...");
         BuildAverageDiffs();
     }
 }
예제 #2
0
 protected AbstractADODiffStorage(AbstractADODataModel dataModel,
                                   String getDiffSQL,
                                   String getDiffsSQL,
                                   String getAverageItemPrefSQL,
                                   String[] updateDiffSQLs,
                                   String[] removeDiffSQLs,
                                   String getRecommendableItemsSQL,
                                   String deleteDiffsSQL,
                                   String createDiffsSQL,
                                   String diffsExistSQL,
                                   int minDiffCount)
 {
     if (dataModel == null)
     {
         throw new ArgumentNullException("dataModel is null");
     }
     if (minDiffCount < 0)
     {
         throw new ArgumentException("minDiffCount is not positive");
     }
     this.dataModel = dataModel;
     this.getDiffSQL = getDiffSQL;
     this.getDiffsSQL = getDiffsSQL;
     this.getAverageItemPrefSQL = getAverageItemPrefSQL;
     this.updateDiffSQLs = updateDiffSQLs;
     this.removeDiffSQLs = removeDiffSQLs;
     this.getRecommendableItemsSQL = getRecommendableItemsSQL;
     this.deleteDiffsSQL = deleteDiffsSQL;
     this.createDiffsSQL = createDiffsSQL;
     this.diffsExistSQL = diffsExistSQL;
     this.minDiffCount = minDiffCount;
     this.refreshLock = new ReentrantLock();
     if (IsDiffsExist())
     {
         log.Info("Diffs already exist in database; using them instead of recomputing");
     }
     else
     {
         log.Info("No diffs exist in database; recomputing...");
         BuildAverageDiffs();
     }
 }