mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
remove lazy loading
This commit is contained in:
@@ -5,7 +5,6 @@ import java.util.Set;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
@@ -27,7 +26,7 @@ public class Feed extends AbstractModel {
|
||||
@Column(length = 1024)
|
||||
private String message;
|
||||
|
||||
@OneToMany(mappedBy = "feed", fetch = FetchType.EAGER)
|
||||
@OneToMany(mappedBy = "feed")
|
||||
private Set<FeedEntry> entries = Sets.newHashSet();
|
||||
|
||||
public Feed() {
|
||||
|
||||
@@ -4,7 +4,6 @@ import java.util.Set;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
@@ -25,8 +24,8 @@ public class FeedCategory extends AbstractModel {
|
||||
@ManyToOne
|
||||
private FeedCategory parent;
|
||||
|
||||
@OneToMany(mappedBy = "category", fetch = FetchType.EAGER)
|
||||
private Set<FeedSubscription> subscriptions = Sets.newHashSet();
|
||||
@OneToMany(mappedBy = "category")
|
||||
private Set<FeedSubscription> subscriptions;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
@@ -53,6 +52,9 @@ public class FeedCategory extends AbstractModel {
|
||||
}
|
||||
|
||||
public Set<FeedSubscription> getSubscriptions() {
|
||||
if (subscriptions == null) {
|
||||
return Sets.newHashSet();
|
||||
}
|
||||
return subscriptions;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.Date;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
@@ -18,7 +19,7 @@ public class FeedEntry extends AbstractModel {
|
||||
@Column(length = 2048)
|
||||
private String guid;
|
||||
|
||||
@ManyToOne
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
private Feed feed;
|
||||
|
||||
@Column(length = 2048)
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.commafeed.backend.model;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.FetchType;
|
||||
import javax.persistence.ManyToOne;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@@ -10,10 +11,10 @@ import javax.persistence.Table;
|
||||
@SuppressWarnings("serial")
|
||||
public class FeedSubscription extends AbstractModel {
|
||||
|
||||
@ManyToOne
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
private User user;
|
||||
|
||||
@ManyToOne
|
||||
@ManyToOne(fetch = FetchType.EAGER)
|
||||
private Feed feed;
|
||||
|
||||
@Column(length = 128)
|
||||
|
||||
Reference in New Issue
Block a user