<?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="OAuthAccessorRecord"
            class="org.apache.roller.weblogger.pojos.OAuthAccessorRecord" access="PROPERTY">
        <table name="roller_oauthaccessor"/>
        <named-query name="OAuthAccessorRecord.getByKey">
            <query>SELECT p FROM OAuthAccessorRecord p WHERE p.consumerKey = ?1</query>
        </named-query>
        <named-query name="OAuthAccessorRecord.getByToken">
            <query>SELECT p FROM OAuthAccessorRecord p WHERE p.requestToken = ?1 OR p.accessToken = ?1</query>
        </named-query>
        <named-query name="OAuthAccessorRecord.getByUserName">
            <query>SELECT p FROM OAuthAccessorRecord p WHERE p.userName = ?1</query>
        </named-query>
        <attributes>
            <id name="consumerKey">
                <column name="consumerkey"/>
            </id>
            <basic name="requestToken">
                <column name="requesttoken" insertable="true" updatable="true" unique="false"/>
            </basic>
            <basic name="accessToken">
                <column name="accesstoken" insertable="true" updatable="true" unique="false"/>
            </basic>
            <basic name="tokenSecret">
                <column name="tokensecret" insertable="true" updatable="true" unique="false"/>
            </basic>
            <basic name="created">
                <column name="created" insertable="true" updatable="true" unique="false"/>
            </basic>
            <basic name="updated">
                <column name="updated" insertable="true" updatable="true" unique="false"/>
            </basic>
            <basic name="authorized">
                <column name="authorized" insertable="true" updatable="true" unique="false"/>
            </basic>
            <basic name="userName">
                <column name="username" insertable="true" updatable="true" unique="true"/>
            </basic>
        </attributes>
    </entity>
</entity-mappings>
