<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>

    <class name="jm28.Categoria" table="categoria">

        <id name="id">
            <column name="ID" not-null="true"/>
            <generator class="identity"/>
        </id>

        <property name="nome">
            <column name="NOME" length="20" not-null="true"/>
        </property>

        <property name="desconto">
            <column name="DESCONTO" not-null="true"/>
        </property>

        <property name="parcelas">
            <column name="PARCELAS" not-null="true"/>
        </property>

        <set name="clientes" inverse="true" cascade="save-update">
            <key column="CATEGORIA"/>
            <one-to-many class="jm28.Cliente"/>
        </set>

        </class>

</hibernate-mapping>
