HibtagsJSP 1.2 tag library for Hibernate 2.1 |
|
|
Example 7
Find all cats over 15 pounds and deletes them one by one. The
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="http://hibtags.lokitech.com/taglib" prefix="hib" %>
<%-- Open a new session for this page --%>
<hib:session>
<%-- Finds cats over 15 pounds --%>
<hib:find var="fatcats">
from Cat c
where c.weight > 15
</hib:find>
<%-- Loops over our fat cats and deletes them one by one --%>
<c:forEach items="${fatcats}" var="fatcat">
<hib:delete target="${fatcat}" />
</c:forEach>
<%-- Close the current session --%>
</hib:session>
Uses |
Home
Examples Documentation Mailing list Download About Us License CVS SF page |