use a onetomany relationship for push info to avoid hibernate automatic lazy loading of onetoone optional relationships

This commit is contained in:
Athou
2013-05-30 10:24:30 +02:00
parent 84a8566af4
commit 0aee6850d5
6 changed files with 16 additions and 13 deletions

View File

@@ -23,6 +23,7 @@ import com.commafeed.backend.feeds.FeedUtils;
import com.commafeed.backend.model.Feed;
import com.commafeed.backend.model.FeedPushInfo;
import com.commafeed.backend.services.ApplicationSettingsService;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
public class SubscriptionHandler {
@@ -37,7 +38,7 @@ public class SubscriptionHandler {
FeedPushInfoDAO feedPushInfoDAO;
public void subscribe(Feed feed) {
FeedPushInfo info = feed.getPushInfo();
FeedPushInfo info = Iterables.getFirst(feed.getPushInfo(), null);
String hub = info.getHub();
String topic = info.getTopic();
String publicUrl = FeedUtils