<?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.planet.pojos</package>
    <entity metadata-complete="true" name="Planet"
            class="org.apache.roller.planet.pojos.Planet" access="PROPERTY">
        <table name="rag_planet"/>
        <named-query name="Planet.getAll">
            <query>SELECT p FROM Planet p</query>
        </named-query>
        <named-query name="Planet.getByHandle">
            <query>SELECT p FROM Planet p WHERE p.handle = ?1</query>
        </named-query>
        <attributes>
            <id name="id">
                <column name="id"/>
            </id>
            <basic name="title">
                <column name="title" insertable="true" updatable="true" unique="false"/>
            </basic>
            <basic name="description">
                <column name="description" insertable="true" updatable="true" unique="false"/>
            </basic>
            <basic name="handle">
                <column name="handle" insertable="true" updatable="true" unique="true"/>
            </basic>
            <one-to-many name="groups" mapped-by="planet" target-entity="org.apache.roller.planet.pojos.PlanetGroup" fetch="LAZY">
                <cascade>
                    <cascade-all/>
                </cascade>
            </one-to-many>
        </attributes>
    </entity>
</entity-mappings>
