<?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="UserRole" class="org.apache.roller.weblogger.pojos.UserRole"
            access="PROPERTY">
        <table name="userrole"/>
        
        <named-query name="UserRole.getByUserName">
            <query>SELECT r FROM UserRole r WHERE r.userName = ?1</query>
        </named-query>
        
        <named-query name="UserRole.getByUserNameAndRole">
            <query>SELECT r FROM UserRole r WHERE r.userName = ?1 AND r.role = ?2</query>
        </named-query>
        
        <attributes>
            <id name="id">
                <column name="id"/>
            </id>
            <basic name="userName">
                <column name="username" insertable="true" updatable="true" unique="false"/>
            </basic>
            <basic name="role">
                <column name="rolename" insertable="true" updatable="true" unique="false"/>
            </basic>            
        </attributes>
        
    </entity>
</entity-mappings>
