<?xml version="1.0" encoding="UTF-8" ?>
<!--
    Author: Sanjeeb.Sahoo@Sun.COM
  -->
<taglib xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee web-jsptaglibrary_2_1.xsd"
    version="2.1">
    <tlib-version>1.0</tlib-version>
    <uri>http://weblogs.java.net/ss141213/tags/jpa</uri>
    <short-name>jpa</short-name>
    <display-name>Tag Library for Java Persistence API</display-name>
    <description>
        A set of tags for using Java Persistence API (JSR 220) in JSPs.
    </description>
    <tag>
        <name>tx</name>
        <description>
            This tag can be used to mark boundary of a user transaction.
            If there is no active tx, it begins a new tx whose scope is same as
            the scope of this tag. Whether the new transaction is rolled back or
            committed depends on if there is any exception or not.
            It optionally makes available the UserTransaction object in a
            request scoped variable whose id is supplied by caller.
        </description>
        <tag-class>com.sun.jpatl.TXTag</tag-class>
        <attribute>
            <name>id</name>
            <required>false</required>
            <type>String</type>
            <description>Name of the output variable</description>
        </attribute>
        <tei-class>com.sun.jpatl.TXTag$ExtraInfo</tei-class>
    </tag>

    <tag>
        <name>injectDefaultPU</name>
        <description>
            This tag can be used to inject a default persistence unit into
            a JSP. The injected persistence unit is made available in a
            page scope variable whose id is required to be supplied by the
            caller. Note the type of the injected variable is
            EntityManagerFactory.
        </description>
        <tag-class>com.sun.jpatl.InjectDefaultPUTag</tag-class>
        <attribute>
            <name>id</name>
            <required>true</required>
            <type>String</type>
            <description> The name of the PAGE scope variable that will
            hold reference to the injected EntityManagerFactory
            </description>
        </attribute>
        <body-content>empty</body-content>
        <tei-class>com.sun.jpatl.InjectDefaultPUTag$ExtraInfo</tei-class>
    </tag>

    <tag>
        <name>injectDefaultPC</name>
        <description>
            This tag can be used to inject a default persistence context into
            a JSP. The injected persistence context is made available in a
            page scope variable whose id is required to be supplied by the
            caller. Note the type of the injected variable is
            EntityManager.
        </description>
        <tag-class>com.sun.jpatl.InjectDefaultPCTag</tag-class>
        <attribute>
            <name>id</name>
            <required>true</required>
            <type>String</type>
            <description> The name of the PAGE scope variable that will
            hold reference to the injected EntityManager
            </description>
        </attribute>
        <body-content>empty</body-content>
        <tei-class>com.sun.jpatl.InjectDefaultPCTag$ExtraInfo</tei-class>
    </tag>

    <tag>
        <name>createPC</name>
        <description>
            Creates a new stanadalone PersistenceContext.
            By default it creates TRANSACTION scoped PC.
        </description>
        <tag-class>com.sun.jpatl.CreatePCTag</tag-class>
        <attribute>
            <name>emf</name>
            <required>true</required>
            <type>String</type>
            <description>
                Name of the variable holding reference to the
                EntityManagerFactory to be used for creation of the PC.
            </description>
        </attribute>
        <attribute>
            <name>type</name>
            <required>false</required>
            <type>String</type>
            <description>
                Can be either TRANSACTION (default) or EXTENDED.
            </description>
        </attribute>
        <attribute>
            <name>id</name>
            <required>true</required>
            <type>String</type>
            <description>
                Name of the output variable
            </description>
        </attribute>
        <body-content>empty</body-content>
        <tei-class>com.sun.jpatl.CreatePCTag$ExtraInfo</tei-class>
    </tag>

    <tag>
        <name>persist</name>
        <description> persist an object in database </description>
        <tag-class>com.sun.jpatl.PersistTag</tag-class>
        <attribute>
            <name>em</name>
            <required>true</required>
            <description>
                Name of the variable holding reference to an EntityManager
            </description>
        </attribute>
        <attribute>
            <name>object</name>
            <type>Object</type>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
            <description>the object to be persisted</description>
        </attribute>
        <body-content>empty</body-content>
    </tag>

    <tag>
        <name>remove</name>
        <description> remove an object from database </description>
        <tag-class>com.sun.jpatl.RemoveTag</tag-class>
        <attribute>
            <name>em</name>
            <required>true</required>
            <description>
                Name of the variable holding reference to an EntityManager
            </description>
        </attribute>
        <attribute>
            <name>object</name>
            <type>Object</type>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
            <description>the object to be removed</description>
        </attribute>
        <body-content>empty</body-content>
    </tag>

    <tag>
        <name>refresh</name>
        <description>
            refresh in memory object with state in database
        </description>
        <tag-class>com.sun.jpatl.RefreshTag</tag-class>
        <attribute>
            <name>em</name>
            <required>true</required>
            <description>
                Name of the variable holding reference to an EntityManager
            </description>
        </attribute>
        <attribute>
            <name>object</name>
            <type>Object</type>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
            <description>the object to be refreshed</description>
        </attribute>
        <body-content>empty</body-content>
    </tag>

    <tag>
        <name>find</name>
        <description> find an object with given primary key </description>
        <tag-class>com.sun.jpatl.FindTag</tag-class>
        <attribute>
            <name>em</name>
            <required>true</required>
            <description>Name of the variable holding reference to
            an EntityManager</description>
        </attribute>
        <attribute>
            <name>clazz</name>
            <required>true</required>
            <description>fully qualified name of the entity class</description>
            <type>String</type>
        </attribute>
        <attribute>
            <name>pk</name>
            <type>Object</type>
            <required>true</required>
            <rtexprvalue>true</rtexprvalue>
            <description>primary key</description>
        </attribute>
        <attribute>
            <name>id</name>
            <required>true</required>
            <description>Name of output variable</description>
        </attribute>
        <body-content>empty</body-content>
        <tei-class>com.sun.jpatl.FindTag$ExtraInfo</tei-class>
    </tag>
</taglib>

