<?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="OAuthConsumerRecord"
            class="org.apache.roller.weblogger.pojos.OAuthConsumerRecord" access="PROPERTY">
        <table name="roller_oauthconsumer"/>
        <named-query name="OAuthConsumerRecord.getByConsumerKey">
            <query>SELECT p FROM OAuthConsumerRecord p WHERE p.consumerKey = ?1</query>
        </named-query>
        <named-query name="OAuthConsumerRecord.getByUsername">
            <query>SELECT p FROM OAuthConsumerRecord p WHERE p.userName = ?1</query>
        </named-query>
        <named-query name="OAuthConsumerRecord.getSiteWideConsumer">
            <query>SELECT p FROM OAuthConsumerRecord p WHERE p.userName IS NULL</query>
        </named-query>
        <attributes>
            <id name="consumerKey">
                <column name="consumerkey"/>
            </id>
            <basic name="consumerSecret">
                <column name="consumersecret" insertable="true" updatable="true" unique="false"/>
            </basic>
            <basic name="userName">
                <column name="username" insertable="true" updatable="true" unique="true"/>
            </basic>
        </attributes>
    </entity>
</entity-mappings>
