<?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">

    <package>org.apache.roller.weblogger.pojos</package>
    <entity metadata-complete="true" name="WeblogPermission"
            class="org.apache.roller.weblogger.pojos.WeblogPermission" access="PROPERTY">
        <discriminator-value>Weblog</discriminator-value>

        <named-query name="WeblogPermission.getByUserName">
            <query>SELECT p FROM WeblogPermission p WHERE p.userName = ?1 AND p.pending &lt;&gt; TRUE</query>
        </named-query>

        <named-query name="WeblogPermission.getByUserName&amp;Pending">
            <query>SELECT p FROM WeblogPermission p WHERE p.userName = ?1 AND p.pending = TRUE</query>
        </named-query>

        <named-query name="WeblogPermission.getByWeblogId">
            <query>SELECT p FROM WeblogPermission p WHERE p.objectId = ?1 AND p.pending &lt;&gt; TRUE</query>
        </named-query>

        <named-query name="WeblogPermission.getByWeblogId&amp;Pending">
            <query>SELECT p FROM WeblogPermission p WHERE p.objectId = ?1 AND p.pending = TRUE</query>
        </named-query>

        <named-query name="WeblogPermission.getByWeblogIdIncludingPending">
            <query>SELECT p FROM WeblogPermission p WHERE p.objectId = ?1</query>
        </named-query>

        <named-query name="WeblogPermission.getByUserName&amp;WeblogId">
            <query>SELECT p FROM WeblogPermission p WHERE p.userName = ?1 AND p.objectId = ?2 AND p.pending &lt;&gt; true</query>
        </named-query>

        <named-query name="WeblogPermission.getByUserName&amp;WeblogIdIncludingPending">
            <query>SELECT p FROM WeblogPermission p WHERE p.userName = ?1 AND p.objectId = ?2</query>
        </named-query>

        <attributes>
            <transient name="user"/>
            <transient name="weblog"/>
        </attributes>
    </entity>
</entity-mappings>
