mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
code cleanup
This commit is contained in:
@@ -59,7 +59,7 @@ public class FeedCategoryDAO extends GenericDAO<FeedCategory> {
|
||||
return list;
|
||||
}
|
||||
|
||||
public boolean isChild(FeedCategory child, FeedCategory parent) {
|
||||
private boolean isChild(FeedCategory child, FeedCategory parent) {
|
||||
if (parent == null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -34,13 +34,6 @@ public class FeedEntryDAO extends GenericDAO<FeedEntry> {
|
||||
.list(entry);
|
||||
}
|
||||
|
||||
public int delete(Feed feed, int max) {
|
||||
List<FeedEntry> list = newQuery().from(entry).where(entry.feed.eq(feed)).limit(max).list(entry);
|
||||
int deleted = list.size();
|
||||
delete(list);
|
||||
return deleted;
|
||||
}
|
||||
|
||||
public int delete(Date olderThan, int max) {
|
||||
List<FeedEntry> list = newQuery().from(entry).where(entry.inserted.lt(olderThan)).limit(max).list(entry);
|
||||
int deleted = list.size();
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.mysema.query.jpa.hibernate.HibernateQuery;
|
||||
|
||||
public abstract class GenericDAO<T extends AbstractModel> extends AbstractDAO<T> {
|
||||
|
||||
public GenericDAO(SessionFactory sessionFactory) {
|
||||
protected GenericDAO(SessionFactory sessionFactory) {
|
||||
super(sessionFactory);
|
||||
}
|
||||
|
||||
@@ -56,9 +56,4 @@ public abstract class GenericDAO<T extends AbstractModel> extends AbstractDAO<T>
|
||||
return objects.size();
|
||||
}
|
||||
|
||||
protected void setTimeout(javax.persistence.Query query, int queryTimeout) {
|
||||
if (queryTimeout > 0) {
|
||||
query.setHint("javax.persistence.query.timeout", queryTimeout);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user