Пример #1
0
 private Feed assignUnusedId(Feed feed) {
   try {
     if (!InfoWallApplication.getInstance()
         .getDatabaseHelper()
         .getFeedReaderDAO()
         .idExists(feed.getFeedReaderID())) return feed;
     else feed.setFeedReaderID(feed.getFeedReaderID() + 1);
     feed = assignUnusedId(feed);
   } catch (SQLException e) {
     e.printStackTrace();
   }
   return feed;
 }
Пример #2
0
  public Feed mapDBFeedToFeed(DBFeed dbFeed) {
    Feed feed = new Feed();

    if (dbFeed != null) {
      feed.setImageURL(dbFeed.getImageURL());
      feed.setTitle(dbFeed.getTitle());
      feed.setDescription(dbFeed.getDescription());
      feed.setFeed(dbFeed.getFeed());
      feed.setFeedReaderID(dbFeed.getFeedReaderID());
      feed.setWebsite(dbFeed.getWebsite());
      feed.setSyncStatus(dbFeed.isSyncStatus());
    }

    return feed;
  }
Пример #3
0
  public DBFeed mapFeedToDBFeed(Feed feed) {
    DBFeed dbFeed = new DBFeed();

    if (dbFeed != null) {
      dbFeed.setImageURL(feed.getImageURL());
      dbFeed.setTitle(feed.getTitle());
      dbFeed.setDescription(feed.getDescription());
      dbFeed.setFeed(feed.getFeed());
      dbFeed.setFeedReaderID(feed.getFeedReaderID());
      dbFeed.setWebsite(feed.getWebsite());
      dbFeed.setSyncStatus(feed.isSyncStatus());
    }

    return dbFeed;
  }
Пример #4
0
 @Override
 public boolean delete(Object object) {
   Feed feed = (Feed) object;
   deleteByID(feed.getFeedReaderID());
   return false;
 }