moved queries to xml file

This commit is contained in:
Athou
2013-03-25 23:15:19 +01:00
parent edbf95c5cd
commit 6d3d03ef53
2 changed files with 15 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings version="2.0" xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/persistence/orm
http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
<named-query name="Entry.unreadByFeed">
<query>select e from FeedEntry e where e.feed=:feed and not exists (select s from FeedEntryStatus s where s.entry = e and s.user =:user and s.read=true)</query>
</named-query>
<named-query name="Entry.readByFeed">
<query>select e from FeedEntry e where e.feed=:feed and exists (select s from FeedEntryStatus s where s.entry = e and s.user =:user and s.read=true)</query>
</named-query>
</entity-mappings>

View File

@@ -8,6 +8,7 @@
<jta-data-source>${jpa.datasource.name}</jta-data-source>
<properties>
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
<property name="openjpa.Log" value="DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE"/>
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="false" />
<property name="toplink.ddl-generation" value="drop-and-create-tables"/>