Remove overloaded method

pull/467/head
Alex Baker 8 years ago
parent ddbd656485
commit baf8e91f49

@ -56,10 +56,6 @@ public class DatabaseDao<TYPE extends AbstractModel> {
}
public void query(Query query, Callback<TYPE> callback) {
query(callback, query);
}
public void query(Callback<TYPE> callback, Query query) {
query(query).forEach(callback);
}

@ -142,7 +142,8 @@ public class MetadataDao {
}
public void byTask(long taskId, Callback<Metadata> callback) {
dao.query(callback, Query.select(Metadata.PROPERTIES).where(Metadata.TASK.eq(taskId)));
Query query = Query.select(Metadata.PROPERTIES).where(Metadata.TASK.eq(taskId));
dao.query(query, callback);
}
public List<Metadata> byTaskAndKey(long taskId, String key) {
@ -151,8 +152,9 @@ public class MetadataDao {
}
public void byTaskAndKey(long taskId, String key, Callback<Metadata> callback) {
dao.query(callback, Query.select(Metadata.PROPERTIES).where(
Criterion.and(Metadata.TASK.eq(taskId), Metadata.KEY.eq(key))));
Query query = Query.select(Metadata.PROPERTIES)
.where(Criterion.and(Metadata.TASK.eq(taskId), Metadata.KEY.eq(key)));
dao.query(query, callback);
}
}

@ -46,9 +46,10 @@ public class TagDataDao {
public void allTags(Callback<TagData> callback) {
// TODO: does this need to be ordered?
dao.query(callback, Query.select(TagData.PROPERTIES)
Query query = Query.select(TagData.PROPERTIES)
.where(TagData.DELETION_DATE.eq(0))
.orderBy(Order.asc(TagData.ID)));
.orderBy(Order.asc(TagData.ID));
dao.query(query, callback);
}
public TagData getByUuid(String uuid) {
@ -60,10 +61,11 @@ public class TagDataDao {
}
public void tagDataOrderedByName(Callback<TagData> callback) {
dao.query(callback, Query.select(TagData.PROPERTIES).where(Criterion.and(
TagData.DELETION_DATE.eq(0),
TagData.NAME.isNotNull())
).orderBy(Order.asc(Functions.upper(TagData.NAME))));
Query query = Query.select(TagData.PROPERTIES).where(Criterion.and(
TagData.DELETION_DATE.eq(0),
TagData.NAME.isNotNull()))
.orderBy(Order.asc(Functions.upper(TagData.NAME)));
dao.query(query, callback);
}
public void persist(TagData tagData) {

@ -27,7 +27,8 @@ public class TaskAttachmentDao {
}
public void getAttachments(String taskUuid, Callback<TaskAttachment> callback) {
dao.query(callback, byUuid(taskUuid, TaskAttachment.PROPERTIES));
Query query = byUuid(taskUuid, TaskAttachment.PROPERTIES);
dao.query(query, callback);
}
private static Query byUuid(String taskUuid, Property<?>... properties) {

@ -26,10 +26,11 @@ public class UserActivityDao {
}
public void getCommentsForTask(String taskUuid, Callback<UserActivity> callback) {
dao.query(callback, Query.select(UserActivity.PROPERTIES).where(
Query query = Query.select(UserActivity.PROPERTIES).where(
Criterion.and(UserActivity.ACTION.eq(UserActivity.ACTION_TASK_COMMENT),
UserActivity.TARGET_ID.eq(taskUuid),
UserActivity.DELETED_AT.eq(0))
).orderBy(Order.desc("1")));
UserActivity.DELETED_AT.eq(0)))
.orderBy(Order.desc("1"));
dao.query(query, callback);
}
}

Loading…
Cancel
Save