mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
major improvement in the way data is stored
This commit is contained in:
@@ -13,7 +13,7 @@ public class FeedEntryStatus extends AbstractModel {
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(nullable = false)
|
||||
private User user;
|
||||
private FeedSubscription subscription;
|
||||
|
||||
@ManyToOne
|
||||
@JoinColumn(nullable = false)
|
||||
@@ -23,12 +23,12 @@ public class FeedEntryStatus extends AbstractModel {
|
||||
private boolean read;
|
||||
private boolean starred;
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
public FeedSubscription getSubscription() {
|
||||
return subscription;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
public void setSubscription(FeedSubscription subscription) {
|
||||
this.subscription = subscription;
|
||||
}
|
||||
|
||||
public FeedEntry getEntry() {
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
package com.commafeed.backend.model.extended;
|
||||
|
||||
import org.apache.commons.lang.builder.EqualsBuilder;
|
||||
import org.apache.commons.lang.builder.HashCodeBuilder;
|
||||
|
||||
import com.commafeed.backend.model.FeedEntry;
|
||||
import com.commafeed.backend.model.FeedEntryStatus;
|
||||
|
||||
public class FeedEntryWithStatus {
|
||||
private FeedEntry entry;
|
||||
private FeedEntryStatus status;
|
||||
|
||||
public FeedEntryWithStatus(FeedEntry entry, FeedEntryStatus status) {
|
||||
this.entry = entry;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return new HashCodeBuilder(17, 37).append(entry.getId())
|
||||
.append(status == null ? null : status.getId()).toHashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (obj.getClass() != getClass()) {
|
||||
return false;
|
||||
}
|
||||
FeedEntryWithStatus rhs = (FeedEntryWithStatus) obj;
|
||||
return new EqualsBuilder()
|
||||
.append(status == null ? null : status.getId(),
|
||||
rhs.status == null ? null : rhs.status.getId())
|
||||
.append(entry.getId(), rhs.entry.getId()).isEquals();
|
||||
|
||||
}
|
||||
|
||||
public FeedEntry getEntry() {
|
||||
return entry;
|
||||
}
|
||||
|
||||
public void setEntry(FeedEntry entry) {
|
||||
this.entry = entry;
|
||||
}
|
||||
|
||||
public FeedEntryStatus getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(FeedEntryStatus status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user