code cleanup

This commit is contained in:
Athou
2014-08-14 11:40:30 +02:00
parent cda6cb5cc0
commit 1324269f1d
7 changed files with 16 additions and 53 deletions

View File

@@ -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;
}

View File

@@ -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();

View File

@@ -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);
}
}
}