less database calls

This commit is contained in:
Athou
2013-07-23 16:19:19 +02:00
parent 150920e0c8
commit d95e1522d8
3 changed files with 51 additions and 39 deletions

View File

@@ -4,9 +4,13 @@
xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
<named-query name="Statuses.deleteOld">
<query>delete from FeedEntryStatus s where s.entryInserted &lt; :date and s.starred = false</query>
</named-query>
<named-query name="EntryStatus.existing">
<query>select new com.commafeed.backend.dao.FeedEntryDAO$EntryWithFeed(e, f) FROM FeedEntry e LEFT JOIN e.feedRelationships f WITH f.feed.id = :feedId where e.guidHash = :guidHash and e.url = :url</query>
</named-query>
</entity-mappings>